19
19
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
20
// THE SOFTWARE.
21
21
22
+ using System . Runtime . CompilerServices ;
22
23
using System ;
23
24
using System . Collections . Generic ;
24
- //using System.Linq;
25
25
using System . Reflection ;
26
26
27
+ #if SIGNED
28
+ [ assembly: InternalsVisibleTo ( "UnitsNet.Serialization.JsonNet, PublicKey=002400000480000094000000060200000024000052534131000400000100010089abdcb0025f7d1c4c766686dd852b978ca5bb9fd80bba9d3539e8399b01170ae0ea10c0c3baa301b1d13090d5aff770532de00c88b67c4b24669fde7f9d87218f1c6c073a09016cbb2f87119b94227c2301f4e2a096043e30f7c47c872bbd8e0b80d924952e6b36990f13f847e83e9efb107ec2121fe39d7edaaa4e235af8c4" ) ]
29
+ #else
30
+ [ assembly: InternalsVisibleTo ( "UnitsNet.Serialization.JsonNet" ) ]
31
+ #endif
32
+
27
33
// Based on
28
34
// https://github.com/StefH/ReflectionBridge/blob/c1e34e57fe3fc93507e83d5cebc1677396645397/ReflectionBridge/src/ReflectionBridge/Extensions/ReflectionBridgeExtensions.cs
29
35
// MIT license
@@ -205,8 +211,18 @@ internal static bool IsValueType(this Type type)
205
211
//#endif
206
212
// }
207
213
214
+ internal static PropertyInfo GetPropety ( this Type type , string name )
215
+ {
216
+ #if ( NET40 || NET35 || NET20 || SILVERLIGHT )
217
+ return type . GetProperty ( name ) ;
218
+
219
+ #else
220
+ return type . GetTypeInfo ( ) . GetDeclaredProperty ( name ) ;
221
+ #endif
222
+ }
223
+
208
224
#if ! ( NET40 || NET35 || NET20 || SILVERLIGHT )
209
- // Ambiguous method conflict with GetMethods() name WindowsRuntimeComponent, so use GetDeclaredMethods() instead
225
+ // Ambiguous method conflict with GetMethods() name when targeting WindowsRuntimeComponent, so use GetDeclaredMethods() instead
210
226
internal static IEnumerable < MethodInfo > GetDeclaredMethods ( this Type someType )
211
227
{
212
228
Type t = someType ;
@@ -245,7 +261,7 @@ internal static IEnumerable<MethodInfo> GetDeclaredMethods(this Type someType)
245
261
// return type.GetTypeInfo().GetCustomAttributes(attributeType, inherit).Cast<Attribute>().ToArray();
246
262
// }
247
263
#else
248
- // Ambiguous method conflict with GetMethods() name WindowsRuntimeComponent, so use GetDeclaredMethods() instead
264
+ // Ambiguous method conflict with GetMethods() name WindowsRuntimeComponent, so use GetDeclaredMethods() instead
249
265
internal static IEnumerable < MethodInfo > GetDeclaredMethods ( this Type someType )
250
266
{
251
267
Type t = someType ;
@@ -258,4 +274,4 @@ internal static IEnumerable<MethodInfo> GetDeclaredMethods(this Type someType)
258
274
}
259
275
#endif
260
276
}
261
- }
277
+ }
0 commit comments