Пример #1
0
        public SwiftDate(double timeIntervalSinceNow)
        {
            unsafe
            {
                fixed(byte *thisDataPtr = StructMarshal.Marshaler.PrepareNominal(this))
                {
                    IntPtr thisPtr = new IntPtr(thisDataPtr);

                    NativeMethodsForDDate.PI_DateNewFromInterval(thisPtr, timeIntervalSinceNow);
                }
            }
        }
Пример #2
0
        public SwiftDate(NSDate nSDate)
        {
            unsafe
            {
                fixed(byte *thisDataPtr = StructMarshal.Marshaler.PrepareNominal(this))
                {
                    IntPtr thisPtr = new IntPtr(thisDataPtr);

                    NativeMethodsForDDate.PI_DateNewFromNSDate(thisPtr, nSDate.Handle);
                }
            }
        }
Пример #3
0
        public static SwiftDate SwiftDate_TimeIntervalSince1970(double timeIntervalSince1970)
        {
            unsafe {
                SwiftDate this0 = StructMarshal.DefaultNominal <SwiftDate> ();
                fixed(byte *thisDataPtr = StructMarshal.Marshaler.PrepareNominal(this0))
                {
                    IntPtr thisPtr = new IntPtr(thisDataPtr);

                    NativeMethodsForDDate.PI_Date_timeIntervalSince1970(thisPtr, timeIntervalSince1970);
                    return(this0);
                }
            }
        }
Пример #4
0
        public SwiftDate(double timeInterval, SwiftDate since)
        {
            unsafe
            {
                fixed(byte *thisDataPtr = StructMarshal.Marshaler.PrepareNominal(this))
                {
                    fixed(byte *sinceSwiftDataPtr = StructMarshal.Marshaler.PrepareNominal(since))
                    {
                        IntPtr thisPtr = new IntPtr(thisDataPtr);

                        NativeMethodsForDDate.PI_Date(thisPtr, timeInterval, (IntPtr)sinceSwiftDataPtr);
                    }
                }
            }
        }
Пример #5
0
        public NSDate ToNSDate()
        {
            unsafe
            {
                fixed(byte *thisSwiftDataPtr = StructMarshal.Marshaler.PrepareNominal(this))
                {
                    NSDate retval = null;

                    IntPtr retvalIntPtr = IntPtr.Zero;

                    retvalIntPtr = NativeMethodsForDDate.PImethod_DateXamarin_DateDtoNSDate((IntPtr)thisSwiftDataPtr);
                    retval       = ObjCRuntime.Runtime.GetNSObject <NSDate> (retvalIntPtr);
                    return(retval);
                }
            }
        }
Пример #6
0
 public static SwiftMetatype GetSwiftMetatype()
 {
     return(NativeMethodsForDDate.PIMetadataAccessor_DDate(SwiftMetadataRequest.Complete));
 }