Пример #1
0
        public void RemoveObjectForKey(string key)
        {
            IntPtr handle = ObjC.ToNSString(key);

            ObjC.MessageSendIntPtr(Handle, "removeObjectForKey:", handle);
            ObjC.MessageSend(handle, "release");
        }
Пример #2
0
        public void SetObjectForKey(NSObject obj, string key)
        {
            IntPtr handle = ObjC.ToNSString(key);

            ObjC.MessageSendIntPtr(Handle, "setObject:forKey:", obj.Handle, handle);
            ObjC.MessageSend(handle, "release");
        }
Пример #3
0
        public NSObject AddObserver(string name, Action <NSNotification> action, NSObject fromObject = null)
        {
            var handler = new Observer(action);

            Callbacks.Subscribe(handler, SelectorName, n => action(Runtime.GetNSObject <NSNotification>(n)));
            ObjC.MessageSend(Handle, "addObserver:selector:name:object:", handler.Handle, ObjC.GetSelector(SelectorName), name, fromObject == null ? IntPtr.Zero : fromObject.Handle);
            return(handler);
        }
Пример #4
0
        public static string LocalizedStringFromNumber(double number, NSNumberFormatterStyle style)
        {
            IntPtr handle = ObjC.ToNSNumber(number);
            string text   = ObjC.MessageSendString(_classHandle, "localizedStringFromNumber:numberStyle:", handle, (int)style);

            ObjC.MessageSend(handle, "release");
            return(text);
        }
Пример #5
0
        public string StringFromNumber(double number)
        {
            IntPtr handle = ObjC.ToNSNumber(number);
            string text   = ObjC.MessageSendString(Handle, "stringFromNumber:", handle);

            ObjC.MessageSend(handle, "release");
            return(text);
        }
Пример #6
0
        public NSObject ObjectForKey(string key)
        {
            IntPtr handle = ObjC.ToNSString(key);
            var    value  = Runtime.GetNSObject <NSObject>(ObjC.MessageSendIntPtr(Handle, "objectForKey:", handle));

            ObjC.MessageSend(handle, "release");
            return(value);
        }
Пример #7
0
        public UIActivityViewController(string text, UIImage image)
        {
            IntPtr textHandle = ObjC.ToNSString(text);
            IntPtr array      = ObjC.ToNSArray(new[] { textHandle, image.Handle });

            ObjC.MessageSendIntPtr(Handle, "initWithActivityItems:applicationActivities:", array, IntPtr.Zero);
            ObjC.MessageSend(textHandle, "release");
        }
Пример #8
0
        public static NSDictionary FromObjectAndKey(NSObject obj, string key)
        {
            IntPtr handle     = ObjC.ToNSString(key);
            var    dictionary = Runtime.GetNSObject <NSDictionary>(ObjC.MessageSendIntPtr(_classHandle, "dictionaryWithObject:forKey:", obj.Handle, handle));

            ObjC.MessageSend(handle, "release");
            return(dictionary);
        }
Пример #9
0
        public virtual void Dispose()
        {
            GC.SuppressFinalize(this);

            if (Handle != IntPtr.Zero)
            {
                Runtime.UnregisterNSObject(Handle);
                Callbacks.UnsubscribeAll(this);
                if (_shouldRelease)
                {
                    ObjC.MessageSend(Handle, "release");
                }
            }
        }
Пример #10
0
        public static IntPtr ToNSSet(string[] items)
        {
            IntPtr[] strings = new IntPtr[items.Length];
            for (int i = 0; i < items.Length; i++)
            {
                strings[i] = ToNSString(items[i]);
            }

            IntPtr array = ToNSArray(strings);
            IntPtr set   = ObjC.MessageSendIntPtr(GetClass("NSSet"), "setWithArray:", array);

            //Release everything
            for (int i = 0; i < strings.Length; i++)
            {
                ObjC.MessageSend(strings[i], "release");
            }

            return(set);
        }
Пример #11
0
 public UIActionSheet()
 {
     Handle = ObjC.MessageSendIntPtr(Handle, "init");
     ObjC.MessageSend(Handle, "setDelegate:", Handle);
 }
Пример #12
0
 // TODO: this had an NSDictionary as a parameter, too
 public NSError(string domain, int code)
 {
     ObjC.MessageSend(Handle, "initWithDomain:code:userInfo:", domain, code, IntPtr.Zero);
 }
Пример #13
0
 public void CancelBannerViewAction()
 {
     ObjC.MessageSend(Handle, "cancelBannerViewAction");
 }
Пример #14
0
        public override void Dispose()
        {
            ObjC.MessageSend(Handle, "removeTransactionObserver:", Handle);

            base.Dispose();
        }
Пример #15
0
 public void MakeKeyWindow()
 {
     ObjC.MessageSend(Handle, "makeKeyWindow");
 }
Пример #16
0
 public void SendSubviewToBack(UIView view)
 {
     ObjC.MessageSend(Handle, "sendSubviewToBack:", view.Handle);
 }
Пример #17
0
 public void AddSubview(UIView view)
 {
     ObjC.MessageSend(Handle, "addSubview:", view.Handle);
 }
Пример #18
0
//        public DateTime NextDaylightSavingTimeTransitionAfter(DateTime date)
//        {
//            return (DateTime)ObjC.MessageSendDate(Handle, "nextDaylightSavingTimeTransitionAfterDate:", date);
//        }

        public static void ResetSystemTimeZone()
        {
            ObjC.MessageSend(_classHandle, "resetSystemTimeZone");
        }
Пример #19
0
 public void AddPayment(SKPayment payment)
 {
     ObjC.MessageSend(Handle, "addPayment:", payment.Handle);
 }
Пример #20
0
 internal SKPaymentQueue(IntPtr handle)
     : base(handle)
 {
     ObjC.MessageSend(Handle, "addTransactionObserver:", Handle);
 }
Пример #21
0
 public void BecomeKeyWindow()
 {
     ObjC.MessageSend(Handle, "becomeKeyWindow");
 }
Пример #22
0
 public void RestoreCompletedTransactions()
 {
     ObjC.MessageSend(Handle, "restoreCompletedTransactions");
 }
Пример #23
0
 public void MakeKeyAndVisible()
 {
     ObjC.MessageSend(Handle, "makeKeyAndVisible");
 }
Пример #24
0
 public AdBannerView(AdType type)
 {
     ObjC.MessageSendIntPtr(Handle, "initWithAdType:", (int)type);
     ObjC.MessageSend(Handle, "setDelegate:", Handle);
 }
Пример #25
0
 public void ResignKeyWindow()
 {
     ObjC.MessageSend(Handle, "resignKeyWindow");
 }
Пример #26
0
 public void FinishTransaction(SKPaymentTransaction transaction)
 {
     ObjC.MessageSend(Handle, "finishTransaction:", transaction.Handle);
 }
Пример #27
0
 public void BringSubviewToFront(UIView view)
 {
     ObjC.MessageSend(Handle, "bringSubviewToFront:", view.Handle);
 }
Пример #28
0
 public AdBannerView()
 {
     ObjC.MessageSend(Handle, "setDelegate:", Handle);
 }
Пример #29
0
 public void RemoveFromSuperview()
 {
     ObjC.MessageSend(Handle, "removeFromSuperview");
 }
Пример #30
0
 public AdBannerView(CGRect frame)
     : base(frame)
 {
     ObjC.MessageSend(Handle, "setDelegate:", Handle);
 }