Пример #1
0
 public static bool operator ==(XamlMember xamlMember1, XamlMember xamlMember2)
 {
     if (ReferenceEquals(xamlMember1, xamlMember2))
     {
         return(true);
     }
     if (xamlMember1 is null || xamlMember2 is null)
     {
         return(false);
     }
     if (xamlMember1._memberType != xamlMember2._memberType || xamlMember1.Name != xamlMember2.Name)
     {
         return(false);
     }
     if (xamlMember1.IsDirective)
     {
         Debug.Assert(xamlMember2.IsDirective);
         // DeclaringType is null for directives, so we need to compare namespaces.
         // Known and unknown directives are equal if the names and namespaces match
         return(XamlDirective.NamespacesAreEqual((XamlDirective)xamlMember1, (XamlDirective)xamlMember2));
     }
     else
     {
         // Known and unknown members are not equal, even if they otherwise match
         return(xamlMember1.DeclaringType == xamlMember2.DeclaringType &&
                xamlMember1.IsUnknown == xamlMember2.IsUnknown);
     }
 }
 public static bool operator ==(XamlMember xamlMember1, XamlMember xamlMember2)
 {
     if (object.ReferenceEquals(xamlMember1, xamlMember2))
     {
         return(true);
     }
     if (object.ReferenceEquals(xamlMember1, null) || object.ReferenceEquals(xamlMember2, null))
     {
         return(false);
     }
     if ((xamlMember1._memberType != xamlMember2._memberType) || (xamlMember1.Name != xamlMember2.Name))
     {
         return(false);
     }
     if (xamlMember1.IsDirective)
     {
         return(XamlDirective.NamespacesAreEqual((XamlDirective)xamlMember1, (XamlDirective)xamlMember2));
     }
     return((xamlMember1.DeclaringType == xamlMember2.DeclaringType) && (xamlMember1.IsUnknown == xamlMember2.IsUnknown));
 }