コード例 #1
0
 public bool Equals(UserEvent other)
 {
     if (Id != other.Id)
     {
         return(false);
     }
     if (User1 != other.User1 && (User1 == null || !User1.Equals(other.User1)))
     {
         return(false);
     }
     return(User2 == other.User2 || (User2 != null && User2.Equals(other.User2)));
 }
コード例 #2
0
 public override bool Equals(object obj)
 {
     if (obj == null)
     {
         return(false);
     }
     else if (this.GetType() != obj.GetType())
     {
         return(false);
     }
     else
     {
         return(((User1.Equals(((Chat)obj).User1)) && (User2.Equals(((Chat)obj).User2))) || ((User1.Equals(((Chat)obj).User2)) && (User2.Equals(((Chat)obj).User1))));
     }
 }
コード例 #3
0
 protected bool Equals(Friendship other)
 {
     return((User1.Equals(other.User1) && User2.Equals(other.User2)) ||
            (User2.Equals(other.User1) && User1.Equals(other.User2)));
 }