Пример #1
0
        private static void AddPublicMethods(IList <InternalEventPropDescriptor> result, Type clazz)
        {
            var methods = clazz.GetMethods();

            for (int i = 0; i < methods.Length; i++)
            {
                if (methods[i].ReturnType == typeof(void))
                {
                    continue;
                }

                var parameters = methods[i].GetParameters();
                if (parameters.Length >= 2)
                {
                    continue;
                }
                if (parameters.Length == 1)
                {
                    Type parameterType = parameters[0].ParameterType;
                    if ((parameterType != typeof(int)) && ((parameterType != typeof(int?))) &&
                        (parameterType != typeof(String)))
                    {
                        continue;
                    }
                }

                InternalEventPropDescriptor desc = PropertyListBuilderExplicit.MakeMethodDesc(methods[i], methods[i].Name);
                result.Add(desc);
            }

            PropertyHelper.RemoveCLRProperties(result);
        }
Пример #2
0
 private static void AddPublicFields(ICollection <InternalEventPropDescriptor> result, Type clazz)
 {
     FieldInfo[] fields = clazz.GetFields();
     for (int i = 0; i < fields.Length; i++)
     {
         InternalEventPropDescriptor desc = PropertyListBuilderExplicit.MakeFieldDesc(fields[i], fields[i].Name);
         result.Add(desc);
     }
 }
Пример #3
0
 public bool Equals(InternalEventPropDescriptor obj)
 {
     if (ReferenceEquals(null, obj))
     {
         return(false);
     }
     if (ReferenceEquals(this, obj))
     {
         return(true);
     }
     return
         (Equals(obj.propertyName, propertyName) &&
          Equals(obj.readMethod, readMethod) &&
          Equals(obj.accessorField, accessorField) &&
          Equals(obj.propertyType, propertyType));
 }
Пример #4
0
 /// <summary>Ctor. </summary>
 /// <param name="clazz">is the class</param>
 /// <param name="getter">is the getter</param>
 /// <param name="descriptor">is the property info</param>
 public SimplePropertyInfo(Type clazz, EventPropertyGetter getter, InternalEventPropDescriptor descriptor)
 {
     PropertyType = clazz;
     Getter       = getter;
     Descriptor   = descriptor;
 }