static IntPtr _XamEveryProtocolCtorImpl()
        {
            IntPtr retvalIntPtr;

            retvalIntPtr = NativeMethodsForEveryProtocol.PI_EveryProtocol(EveryProtocol.GetSwiftMetatype());
            return(retvalIntPtr);
        }
Exemple #2
0
 public SwiftExistentialContainer1(EveryProtocol everyProtocol, IntPtr protocolWitnessTable)
 {
     d0  = everyProtocol.SwiftObject;
     d1  = IntPtr.Zero;
     d2  = IntPtr.Zero;
     md  = EveryProtocol.GetSwiftMetatype();
     wt0 = protocolWitnessTable;
 }
Exemple #3
0
 public bool TryGetValue(SwiftMetatype swiftType, out Type csType)
 {
     if (swiftType.Handle == EveryProtocol.GetSwiftMetatype().Handle)
     {
         csType = null;
         return(false);
     }
     lock (registryLock) {
         if (primaryCache.TryGetValue(swiftType, out csType))
         {
             return(true);
         }
         if (IsNamedType(swiftType) && TrySecondaryCache(swiftType, out csType))
         {
             return(true);
         }
         else if (swiftType.Kind == MetatypeKind.Tuple)
         {
             csType = GetTupleType(swiftType);
             if (csType != null)
             {
                 primaryCache.Add(swiftType, csType);
             }
         }
         else if (swiftType.Kind == MetatypeKind.Optional)
         {
             csType = GetOptionalType(swiftType);
             if (csType != null)
             {
                 primaryCache.Add(swiftType, csType);
             }
         }
         else if (swiftType.Kind == MetatypeKind.Function)
         {
             csType = GetFunctionType(swiftType);
             if (csType != null)
             {
                 primaryCache.Add(swiftType, csType);
             }
         }
         else if (swiftType.Kind == MetatypeKind.Protocol)
         {
             csType = GetInterfaceType(swiftType);
         }
         if (csType != null)
         {
             return(true);
         }
         return(false);
     }
 }