From: <fab...@us...> - 2011-04-12 17:55:31
|
Revision: 5679 http://nhibernate.svn.sourceforge.net/nhibernate/?rev=5679&view=rev Author: fabiomaulo Date: 2011-04-12 17:55:24 +0000 (Tue, 12 Apr 2011) Log Message: ----------- Moved classes to the "public" namespace Modified Paths: -------------- trunk/nhibernate/src/NHibernate/NHibernate.csproj Added Paths: ----------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyPath.cs trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyPathExtensions.cs Removed Paths: ------------- trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/PropertyPath.cs trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/PropertyPathExtensions.cs Deleted: trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/PropertyPath.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/PropertyPath.cs 2011-04-12 17:50:33 UTC (rev 5678) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/PropertyPath.cs 2011-04-12 17:55:24 UTC (rev 5679) @@ -1,84 +0,0 @@ -using System; -using System.Reflection; - -namespace NHibernate.Mapping.ByCode.Impl -{ - public class PropertyPath - { - private readonly int hashCode; - private readonly MemberInfo localMember; - private readonly PropertyPath previousPath; - - public PropertyPath(PropertyPath previousPath, MemberInfo localMember) - { - if (localMember == null) - { - throw new ArgumentNullException("localMember"); - } - this.previousPath = previousPath; - this.localMember = localMember; - hashCode = localMember.GetHashCode() ^ (previousPath != null ? previousPath.GetHashCode() : 41); - } - - public PropertyPath PreviousPath - { - get { return previousPath; } - } - - public MemberInfo LocalMember - { - get { return localMember; } - } - - public MemberInfo GetRootMember() - { - PropertyPath analizing = this; - while (analizing.previousPath != null) - { - analizing = analizing.previousPath; - } - return analizing.localMember; - } - - public override bool Equals(object obj) - { - if (ReferenceEquals(null, obj)) - { - return false; - } - if (ReferenceEquals(this, obj)) - { - return true; - } - return Equals(obj as PropertyPath); - } - - public bool Equals(PropertyPath other) - { - if (ReferenceEquals(null, other)) - { - return false; - } - if (ReferenceEquals(this, other)) - { - return true; - } - return hashCode == other.GetHashCode(); - } - - public override int GetHashCode() - { - return hashCode; - } - - public string ToColumnName() - { - return PreviousPath == null ? LocalMember.Name : PreviousPath.ToColumnName() + LocalMember.Name; - } - - public override string ToString() - { - return PreviousPath == null ? LocalMember.Name : PreviousPath + "." + LocalMember.Name; - } - } -} \ No newline at end of file Deleted: trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/PropertyPathExtensions.cs =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/PropertyPathExtensions.cs 2011-04-12 17:50:33 UTC (rev 5678) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/PropertyPathExtensions.cs 2011-04-12 17:55:24 UTC (rev 5679) @@ -1,47 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Reflection; - -namespace NHibernate.Mapping.ByCode.Impl -{ - public static class PropertyPathExtensions - { - public static string ToColumnName(this PropertyPath propertyPath, string pathSeparator) - { - return propertyPath.ToString().Replace(".", pathSeparator); - } - - /// <summary> - /// Provide the list of progressive-paths - /// </summary> - /// <param name="source"></param> - /// <returns> - /// Given a path as : Pl1.Pl2.Pl3.Pl4.Pl5 returns paths-sequence as: - /// Pl5 - /// Pl4.Pl5 - /// Pl3.Pl4.Pl5 - /// Pl2.Pl3.Pl4.Pl5 - /// Pl1.Pl2.Pl3.Pl4.Pl5 - /// </returns> - public static IEnumerable<PropertyPath> InverseProgressivePath(this PropertyPath source) - { - if (source == null) - { - throw new ArgumentNullException("source"); - } - PropertyPath analizing = source; - var returnLocalMembers = new List<MemberInfo>(10); - do - { - returnLocalMembers.Add(analizing.LocalMember); - PropertyPath progressivePath = null; - for (int i = returnLocalMembers.Count - 1; i >= 0; i--) - { - progressivePath = new PropertyPath(progressivePath, returnLocalMembers[i]); - } - yield return progressivePath; - analizing = analizing.PreviousPath; - } while (analizing != null); - } - } -} \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyPath.cs (from rev 5676, trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/PropertyPath.cs) =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyPath.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyPath.cs 2011-04-12 17:55:24 UTC (rev 5679) @@ -0,0 +1,84 @@ +using System; +using System.Reflection; + +namespace NHibernate.Mapping.ByCode +{ + public class PropertyPath + { + private readonly int hashCode; + private readonly MemberInfo localMember; + private readonly PropertyPath previousPath; + + public PropertyPath(PropertyPath previousPath, MemberInfo localMember) + { + if (localMember == null) + { + throw new ArgumentNullException("localMember"); + } + this.previousPath = previousPath; + this.localMember = localMember; + hashCode = localMember.GetHashCode() ^ (previousPath != null ? previousPath.GetHashCode() : 41); + } + + public PropertyPath PreviousPath + { + get { return previousPath; } + } + + public MemberInfo LocalMember + { + get { return localMember; } + } + + public MemberInfo GetRootMember() + { + PropertyPath analizing = this; + while (analizing.previousPath != null) + { + analizing = analizing.previousPath; + } + return analizing.localMember; + } + + public override bool Equals(object obj) + { + if (ReferenceEquals(null, obj)) + { + return false; + } + if (ReferenceEquals(this, obj)) + { + return true; + } + return Equals(obj as PropertyPath); + } + + public bool Equals(PropertyPath other) + { + if (ReferenceEquals(null, other)) + { + return false; + } + if (ReferenceEquals(this, other)) + { + return true; + } + return hashCode == other.GetHashCode(); + } + + public override int GetHashCode() + { + return hashCode; + } + + public string ToColumnName() + { + return PreviousPath == null ? LocalMember.Name : PreviousPath.ToColumnName() + LocalMember.Name; + } + + public override string ToString() + { + return PreviousPath == null ? LocalMember.Name : PreviousPath + "." + LocalMember.Name; + } + } +} \ No newline at end of file Copied: trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyPathExtensions.cs (from rev 5676, trunk/nhibernate/src/NHibernate/Mapping/ByCode/Impl/PropertyPathExtensions.cs) =================================================================== --- trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyPathExtensions.cs (rev 0) +++ trunk/nhibernate/src/NHibernate/Mapping/ByCode/PropertyPathExtensions.cs 2011-04-12 17:55:24 UTC (rev 5679) @@ -0,0 +1,47 @@ +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace NHibernate.Mapping.ByCode +{ + public static class PropertyPathExtensions + { + public static string ToColumnName(this PropertyPath propertyPath, string pathSeparator) + { + return propertyPath.ToString().Replace(".", pathSeparator); + } + + /// <summary> + /// Provide the list of progressive-paths + /// </summary> + /// <param name="source"></param> + /// <returns> + /// Given a path as : Pl1.Pl2.Pl3.Pl4.Pl5 returns paths-sequence as: + /// Pl5 + /// Pl4.Pl5 + /// Pl3.Pl4.Pl5 + /// Pl2.Pl3.Pl4.Pl5 + /// Pl1.Pl2.Pl3.Pl4.Pl5 + /// </returns> + public static IEnumerable<PropertyPath> InverseProgressivePath(this PropertyPath source) + { + if (source == null) + { + throw new ArgumentNullException("source"); + } + PropertyPath analizing = source; + var returnLocalMembers = new List<MemberInfo>(10); + do + { + returnLocalMembers.Add(analizing.LocalMember); + PropertyPath progressivePath = null; + for (int i = returnLocalMembers.Count - 1; i >= 0; i--) + { + progressivePath = new PropertyPath(progressivePath, returnLocalMembers[i]); + } + yield return progressivePath; + analizing = analizing.PreviousPath; + } while (analizing != null); + } + } +} \ No newline at end of file Modified: trunk/nhibernate/src/NHibernate/NHibernate.csproj =================================================================== --- trunk/nhibernate/src/NHibernate/NHibernate.csproj 2011-04-12 17:50:33 UTC (rev 5678) +++ trunk/nhibernate/src/NHibernate/NHibernate.csproj 2011-04-12 17:55:24 UTC (rev 5679) @@ -409,8 +409,8 @@ <Compile Include="Mapping\ByCode\Impl\OneToManyMapper.cs" /> <Compile Include="Mapping\ByCode\Impl\OneToOneMapper.cs" /> <Compile Include="Mapping\ByCode\Impl\PropertyMapper.cs" /> - <Compile Include="Mapping\ByCode\Impl\PropertyPath.cs" /> - <Compile Include="Mapping\ByCode\Impl\PropertyPathExtensions.cs" /> + <Compile Include="Mapping\ByCode\PropertyPath.cs" /> + <Compile Include="Mapping\ByCode\PropertyPathExtensions.cs" /> <Compile Include="Mapping\ByCode\Impl\SetMapper.cs" /> <Compile Include="Mapping\ByCode\Impl\SubclassMapper.cs" /> <Compile Include="Mapping\ByCode\Impl\TypeNameUtil.cs" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |