Beispiel #1
0
 private static object ToDictionaryObject(this NSDictionary @this, Type targetType)
 {
     if (targetType != null && targetType.IsGenericType && targetType.GetGenericTypeDefinition() == typeof(Dictionary <,>))
     {
         var types = targetType.GenericTypeArguments;
         return(@this.ToDictionary(types[0], types[1]));
     }
     else
     {
         return(@this.Cast(targetType));
     }
 }
Beispiel #2
0
 public static T Cast <T>(this NSDictionary @this, string documentId = null)
 {
     return((T)@this.Cast(typeof(T), documentId));
 }