Ejemplo n.º 1
0
 //2.
 public override bool Equals(object obj)
 {
     if (MetadataKind != ModelMetadataKind.Property || !ContainerType.GetInterfaces().Contains(typeof(ICustomTypeDescriptor)))
     {
         return(base.Equals(obj));
     }
     else
     {
         return(false);
     }
 }
Ejemplo n.º 2
0
 //1.
 public override int GetHashCode()
 {
     if (MetadataKind != ModelMetadataKind.Property || !ContainerType.GetInterfaces().Contains(typeof(ICustomTypeDescriptor)))
     {
         return(base.GetHashCode());
     }
     else
     {
         unchecked
         {
             int hash = 17;
             hash = hash * 31 + base.GetHashCode();
             hash = hash * 31 + new Random().Next();
             return(hash);
         };
     }
 }