// TODO: replace binding flags by bool flags protected MethodBaseInfo(string name, Type declaringType, BindingFlags bindingFlags, Type[] genericArguments, Type[] parameterTypes, Dictionary<Type, TypeInfo> referenceTracker) : this(name, TypeInfo.Create(referenceTracker, declaringType, includePropertyInfos: false, setMemberDeclaringTypes: false), bindingFlags, ReferenceEquals(null, genericArguments) ? null : genericArguments.Select(x => TypeInfo.Create(referenceTracker, x, false, false)), ReferenceEquals(null, parameterTypes) ? null : parameterTypes.Select(x => TypeInfo.Create(referenceTracker, x, false, false))) { }
internal RuntimeConstructorInfo(RuntimeMethodHandleInternal handle, RuntimeType declaringType, RuntimeType.RuntimeTypeCache reflectedTypeCache, MethodAttributes methodAttributes, System.Reflection.BindingFlags bindingFlags) { this.m_bindingFlags = bindingFlags; this.m_reflectedTypeCache = reflectedTypeCache; this.m_declaringType = declaringType; this.m_handle = handle.Value; this.m_methodAttributes = methodAttributes; }
internal RuntimeConstructorInfo(RuntimeMethodHandle handle, RuntimeTypeHandle declaringTypeHandle, RuntimeType.RuntimeTypeCache reflectedTypeCache, MethodAttributes methodAttributes, System.Reflection.BindingFlags bindingFlags) { this.m_bindingFlags = bindingFlags; this.m_handle = handle; this.m_reflectedTypeCache = reflectedTypeCache; this.m_declaringType = declaringTypeHandle.GetRuntimeType(); this.m_parameters = null; this.m_toString = null; this.m_methodAttributes = methodAttributes; }
protected MethodBaseInfo(string name, TypeInfo declaringType, BindingFlags bindingFlags, IEnumerable<TypeInfo> genericArguments, IEnumerable<TypeInfo> parameterTypes) : base(name, declaringType) { BindingFlags = bindingFlags; GenericArgumentTypes = ReferenceEquals(null, genericArguments) || !genericArguments.Any() ? null : genericArguments.ToList(); ParameterTypes = ReferenceEquals(null, parameterTypes) || !parameterTypes.Any() ? null : parameterTypes.ToList(); }
public override System.Reflection.ConstructorInfo[] GetConstructors(System.Reflection.BindingFlags bindingAttr) { throw new NotImplementedException(); }
public virtual System.Reflection.PropertyInfo[] GetProperties(System.Reflection.BindingFlags bindingAttr) { }
public static System.Type[] GetNestedTypes(this System.Type type, System.Reflection.BindingFlags bindingAttr) { throw null; }
public override System.Reflection.PropertyInfo[] GetProperties(System.Reflection.BindingFlags bindingAttr) { throw new NotImplementedException(); }
public static System.Reflection.FieldInfo GetField(this System.Type type, string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
public static System.Reflection.MethodInfo[] GetMethods(this System.Type type, System.Reflection.BindingFlags bindingAttr) { throw null; }
public virtual System.Reflection.FieldInfo GetField(string name, System.Reflection.BindingFlags bindingAttr) { }
public static System.Reflection.ConstructorInfo[] GetConstructors(this System.Type type, System.Reflection.BindingFlags bindingAttr) { throw null; }
public virtual object InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object target, object[] args, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, string[] namedParameters) { }
public virtual System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.BindingFlags bindingAttr) { }
public override Type[] GetNestedTypes(System.Reflection.BindingFlags bindingAttr) { throw new NotImplementedException(); }
public override System.Reflection.MemberInfo[] GetMembers(System.Reflection.BindingFlags bindingAttr) { throw new NotImplementedException(); }
protected override System.Reflection.PropertyInfo GetPropertyImpl(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers) { throw new NotImplementedException(); }
public static bool IsEqual(object obj1, object obj2) { if (obj1 == null && obj2 == null) { return(true); } else if ((obj1 == null && obj2 != null) || (obj1 != null && obj2 == null)) { return(false); } var type = obj1.GetType(); if (type.IsPrimitive || type == typeof(Decimal) || type == typeof(String)) { var obj1Value = obj1.ToString(); var obj2Value = obj2.ToString(); if (obj1Value != obj2Value) { return(false); } } else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Dictionary <,>)) { var dict1 = obj1 as IDictionary; var dict2 = obj2 as IDictionary; var keys = dict1.Keys; foreach (var key in keys) { var dict1Item = dict1[key]; var dict2Item = dict2[key]; if (!IsEqual(dict1Item, dict2Item)) { return(false); } } } else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ConcurrentDictionary <,>)) { // TODO } else if (type.FullName.StartsWith("System.Action")) { // SKIP } else if (type.IsArray) { var array1 = (IEnumerable)obj1; var array2 = (IEnumerable)obj2; var sequence1 = array1.GetEnumerator(); var sequence2 = array2.GetEnumerator(); while (sequence1.MoveNext()) { sequence2.MoveNext(); if (!IsEqual(sequence1.Current, sequence2.Current)) { return(false); } } } else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(List <>)) { // TODO } else if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(ISet <>)) { // TODO } else if (type.IsAbstract) { // SKIP } else { const System.Reflection.BindingFlags bindingAttr = System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance; var props1 = obj1.GetType().GetFields(bindingAttr); //GetProperties(bindingAttr); foreach (var prop1 in props1) { var name = prop1.Name; var prop2 = obj2.GetType().GetField(name, bindingAttr); if (!IsEqual(prop1.GetValue(obj1), prop2.GetValue(obj2))) { return(false); } } } return(true); }
public virtual System.Reflection.FieldInfo[] GetFields(System.Reflection.BindingFlags bindingAttr) { }
public override Object Invoke(System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, Object[] parameters, System.Globalization.CultureInfo culture) { return(default(Object)); }
public virtual System.Reflection.MethodInfo GetMethod(string name, System.Reflection.BindingFlags bindingAttr) { }
public static System.Reflection.EventInfo[] GetEvents(this System.Type type, System.Reflection.BindingFlags bindingAttr) { throw null; }
public virtual System.Reflection.MethodInfo GetMethod(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type[] types, System.Reflection.ParameterModifier[] modifiers) { }
public static System.Reflection.MemberInfo[] GetMember(this System.Type type, string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
public static System.Reflection.PropertyInfo GetProperty(this System.Type type, string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
public static System.Type GetNestedType(this System.Type type, string name, System.Reflection.BindingFlags bindingAttr) { throw null; }
public override object InvokeMember(string name, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, object target, object[] args, System.Reflection.ParameterModifier[] modifiers, System.Globalization.CultureInfo culture, string[] namedParameters) { throw new NotImplementedException(); }
public static System.Reflection.PropertyInfo[] GetProperties(this System.Type type, System.Reflection.BindingFlags bindingAttr) { throw null; }
public override System.Reflection.MemberInfo[] GetMember(string name, System.Reflection.BindingFlags bindingAttr) { return(base.GetMember(name, bindingAttr)); }
public virtual System.Reflection.MethodInfo[] GetMethods(System.Reflection.BindingFlags bindingAttr) { }
protected override System.Reflection.ConstructorInfo GetConstructorImpl(System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, System.Reflection.CallingConventions callConvention, Type[] types, System.Reflection.ParameterModifier[] modifiers) { throw new NotImplementedException(); }
protected RuntimeFieldInfo(RuntimeType.RuntimeTypeCache reflectedTypeCache, RuntimeType declaringType, System.Reflection.BindingFlags bindingFlags) { this.m_bindingFlags = bindingFlags; this.m_declaringType = declaringType; this.m_reflectedTypeCache = reflectedTypeCache; }
public virtual System.Reflection.PropertyInfo GetProperty(string name, System.Reflection.BindingFlags bindingAttr) { }
public virtual System.Reflection.PropertyInfo GetProperty(string name, System.Reflection.BindingFlags bindingAttr, System.Reflection.Binder binder, Type returnType, Type[] types, System.Reflection.ParameterModifier[] modifiers) { }
public override System.Reflection.FieldInfo GetField(string name, System.Reflection.BindingFlags bindingAttr) { throw new NotImplementedException(); }