@@ -46,24 +46,6 @@ internal static Assembly GetAssembly(this Type type)
46
46
#endif
47
47
}
48
48
49
- // internal static bool IsSealed(this Type type)
50
- // {
51
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
52
- // return type.GetTypeInfo().IsSealed;
53
- //#else
54
- // return type.IsSealed;
55
- //#endif
56
- // }
57
- //
58
- // internal static bool IsAbstract(this Type type)
59
- // {
60
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
61
- // return type.GetTypeInfo().IsAbstract;
62
- //#else
63
- // return type.IsAbstract;
64
- //#endif
65
- // }
66
-
67
49
internal static bool IsEnum ( this Type type )
68
50
{
69
51
#if ! ( NET40 || NET35 || NET20 || SILVERLIGHT )
@@ -73,92 +55,6 @@ internal static bool IsEnum(this Type type)
73
55
#endif
74
56
}
75
57
76
- // internal static bool IsClass(this Type type)
77
- // {
78
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
79
- // return type.GetTypeInfo().IsClass;
80
- //#else
81
- // return type.IsClass;
82
- //#endif
83
- // }
84
- //
85
- // internal static bool IsPrimitive(this Type type)
86
- // {
87
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
88
- // return type.GetTypeInfo().IsPrimitive;
89
- //#else
90
- // return type.IsPrimitive;
91
- //#endif
92
- // }
93
- //
94
- // internal static bool IsPublic(this Type type)
95
- // {
96
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
97
- // return type.GetTypeInfo().IsPublic;
98
- //#else
99
- // return type.IsPublic;
100
- //#endif
101
- // }
102
- //
103
- // internal static bool IsNestedPublic(this Type type)
104
- // {
105
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
106
- // return type.GetTypeInfo().IsNestedPublic;
107
- //#else
108
- // return type.IsNestedPublic;
109
- //#endif
110
- // }
111
- //
112
- // internal static bool IsFromLocalAssembly(this Type type)
113
- // {
114
- //#if SILVERLIGHT
115
- // string assemblyName = type.GetAssembly().FullName;
116
- //#else
117
- // string assemblyName = type.GetAssembly().GetName().Name;
118
- //#endif
119
- //
120
- // try
121
- // {
122
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
123
- // Assembly.Load(new AssemblyName {Name = assemblyName});
124
- //#else
125
- // Assembly.Load(assemblyName);
126
- //#endif
127
- // return true;
128
- // }
129
- // catch
130
- // {
131
- // return false;
132
- // }
133
- // }
134
- //
135
- // internal static bool IsGenericType(this Type type)
136
- // {
137
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
138
- // return type.GetTypeInfo().IsGenericType;
139
- //#else
140
- // return type.IsGenericType;
141
- //#endif
142
- // }
143
- //
144
- // internal static bool IsInterface(this Type type)
145
- // {
146
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
147
- // return type.GetTypeInfo().IsInterface;
148
- //#else
149
- // return type.IsInterface;
150
- //#endif
151
- // }
152
- //
153
- // internal static Type BaseType(this Type type)
154
- // {
155
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
156
- // return type.GetTypeInfo().BaseType;
157
- //#else
158
- // return type.BaseType;
159
- //#endif
160
- // }
161
-
162
58
internal static bool IsValueType ( this Type type )
163
59
{
164
60
#if ! ( NET40 || NET35 || NET20 || SILVERLIGHT )
@@ -168,49 +64,6 @@ internal static bool IsValueType(this Type type)
168
64
#endif
169
65
}
170
66
171
- // internal static T GetPropertyValue<T>(this Type type, string propertyName, object target)
172
- // {
173
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
174
- // PropertyInfo property = type.GetTypeInfo().GetDeclaredProperty(propertyName);
175
- // return (T) property.GetValue(target);
176
- //#else
177
- // return (T) type.InvokeMember(propertyName, BindingFlags.GetProperty, null, target, null);
178
- //#endif
179
- // }
180
- //
181
- // internal static void SetPropertyValue(this Type type, string propertyName, object target, object value)
182
- // {
183
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
184
- // PropertyInfo property = type.GetTypeInfo().GetDeclaredProperty(propertyName);
185
- // property.SetValue(target, value);
186
- //#else
187
- // type.InvokeMember(propertyName, BindingFlags.SetProperty, null, target, new object[] {value});
188
- //#endif
189
- // }
190
- //
191
- // internal static void SetFieldValue(this Type type, string fieldName, object target, object value)
192
- // {
193
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
194
- // FieldInfo field = type.GetTypeInfo().GetDeclaredField(fieldName);
195
- // if (field != null)
196
- // field.SetValue(target, value);
197
- // else
198
- // type.SetPropertyValue(fieldName, target, value);
199
- //#else
200
- // type.InvokeMember(fieldName, BindingFlags.SetField | BindingFlags.SetProperty, null, target, new object[] {value});
201
- //#endif
202
- // }
203
- //
204
- // internal static void InvokeMethod<T>(this Type type, string methodName, object target, T value)
205
- // {
206
- //#if !(NET40 || NET35 || NET20 || SILVERLIGHT)
207
- // MethodInfo method = type.GetTypeInfo().GetDeclaredMethod(methodName);
208
- // method.Invoke(target, new object[] {value});
209
- //#else
210
- // type.InvokeMember(methodName, BindingFlags.InvokeMethod, null, target, new object[] {value});
211
- //#endif
212
- // }
213
-
214
67
internal static PropertyInfo GetPropety ( this Type type , string name )
215
68
{
216
69
#if ( NET40 || NET35 || NET20 || SILVERLIGHT )
@@ -234,32 +87,6 @@ internal static IEnumerable<MethodInfo> GetDeclaredMethods(this Type someType)
234
87
t = ti . BaseType ;
235
88
}
236
89
}
237
-
238
- // internal static Type[] GetGenericArguments(this Type type)
239
- // {
240
- // return type.GetTypeInfo().GenericTypeArguments;
241
- // }
242
- //
243
- // /*
244
- // internal static bool IsAssignableFrom(this Type type, Type otherType)
245
- // {
246
- // return type.GetTypeInfo().IsAssignableFrom(otherType.GetTypeInfo());
247
- // }*/
248
- //
249
- // internal static bool IsSubclassOf(this Type type, Type c)
250
- // {
251
- // return type.GetTypeInfo().IsSubclassOf(c);
252
- // }
253
- //
254
- // internal static Attribute[] GetCustomAttributes(this Type type)
255
- // {
256
- // return type.GetTypeInfo().GetCustomAttributes().ToArray();
257
- // }
258
- //
259
- // internal static Attribute[] GetCustomAttributes(this Type type, Type attributeType, bool inherit)
260
- // {
261
- // return type.GetTypeInfo().GetCustomAttributes(attributeType, inherit).Cast<Attribute>().ToArray();
262
- // }
263
90
#else
264
91
// Ambiguous method conflict with GetMethods() name WindowsRuntimeComponent, so use GetDeclaredMethods() instead
265
92
internal static IEnumerable < MethodInfo > GetDeclaredMethods ( this Type someType )
0 commit comments