コード例 #1
0
ファイル: ArchivingActor.cs プロジェクト: smitcham/libpalaso
        /// <summary>Compare 2 ArchivingActor objects. They are identical if they have the same FullName</summary>
        public int CompareTo(object obj)
        {
            if (obj == null)
            {
                return(1);
            }

            ArchivingActor other = obj as ArchivingActor;

            if (other == null)
            {
                throw new ArgumentException();
            }

            var fullNameCompare = String.Compare(GetFullName(), other.GetFullName(), StringComparison.OrdinalIgnoreCase);
            var nameCompare     = String.Compare(GetName(), other.GetName(), StringComparison.OrdinalIgnoreCase);

            return(nameCompare == 0 ? 0 : fullNameCompare);
        }
コード例 #2
0
ファイル: ArchivingActor.cs プロジェクト: smitcham/libpalaso
 /// <summary>Compare 2 ArchivingActor objects. They are identical if they have the same FullName</summary>
 public static int Compare(ArchivingActor actorA, ArchivingActor actorB)
 {
     return(actorA.CompareTo(actorB));
 }