static IntPtr _XamEveryProtocolCtorImpl()
        {
            IntPtr retvalIntPtr;

            retvalIntPtr = NativeMethodsForEveryProtocol.PI_EveryProtocol(EveryProtocol.GetSwiftMetatype());
            return(retvalIntPtr);
        }
예제 #2
0
 public SwiftExistentialContainer1(EveryProtocol everyProtocol, IntPtr protocolWitnessTable)
 {
     d0  = everyProtocol.SwiftObject;
     d1  = IntPtr.Zero;
     d2  = IntPtr.Zero;
     md  = EveryProtocol.GetSwiftMetatype();
     wt0 = protocolWitnessTable;
 }
예제 #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);
     }
 }
 public CustomStringConvertibleXamProxy(ICustomStringConvertible actualImplementation, EveryProtocol everyProtocol)
     : base(typeof(ICustomStringConvertible), everyProtocol)
 {
     actualImpl = actualImplementation;
     container  = new SwiftExistentialContainer1(everyProtocol, ProtocolWitnessTable);
 }
예제 #5
0
 public SwiftComparableProxy(ISwiftComparable actualImplementation, EveryProtocol everyProtocol)
     : base(typeof(ISwiftComparable), everyProtocol)
 {
     actualImpl = actualImplementation;
 }
예제 #6
0
 public BaseProxy(Type interfaceType, EveryProtocol everyProtocol)
 {
     InterfaceType = interfaceType;
     EveryProtocol = everyProtocol;
 }
예제 #7
0
 public SwiftExistentialContainer1(Type interfaceType, EveryProtocol everyProtocol)
     : this(everyProtocol, SwiftMarshal.StructMarshal.Marshaler.ProtocolWitnessof(interfaceType))
 {
 }
예제 #8
0
 public SwiftHashableProxy(SwiftHashableProxy actualImplementation, EveryProtocol everyProtocol)
     : base(typeof(SwiftHashableProxy), everyProtocol)
 {
     actualImpl = actualImplementation;
 }