Пример #1
0
 public bool PropertyExists(PropertyInfo sourceProperty)
 {
     if (sourceProperty.Name.IndexOf('.') >= 0)
     {
         return(true);
     }
     for (int i = 0; i < this.designProperties.Count; i++)
     {
         KeyValuePair <PropertyBuilder, PropertyInfo> item = this.designProperties[i];
         if (item.Value == sourceProperty)
         {
             return(true);
         }
         if (!(item.Key.Name != sourceProperty.Name) && object.Equals(item.Key.PropertyType, sourceProperty.PropertyType))
         {
             if (item.Value == null)
             {
                 return(true);
             }
             if (DesignTypeGenerator.CompareParameters(item.Value.GetIndexParameters(), sourceProperty.GetIndexParameters()))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Пример #2
0
 public bool MethodExists(MethodInfo sourceMethod)
 {
     if (sourceMethod.Name.IndexOf('.') >= 0)
     {
         return(true);
     }
     for (int i = 0; i < this.designMethods.Count; i++)
     {
         KeyValuePair <MethodBuilder, MethodInfo> item = this.designMethods[i];
         if (item.Value == sourceMethod)
         {
             return(true);
         }
         if (!(item.Key.Name != sourceMethod.Name) && object.Equals(item.Key.ReturnType, sourceMethod.ReturnType))
         {
             if (item.Value == null)
             {
                 return(true);
             }
             if (DesignTypeGenerator.CompareParameters(item.Value.GetParameters(), sourceMethod.GetParameters()))
             {
                 return(true);
             }
         }
     }
     return(false);
 }