Exemplo n.º 1
0
        public void RemoveObjectForKey(string key)
        {
            IntPtr handle = ObjC.ToNSString(key);

            ObjC.MessageSendIntPtr(Handle, "removeObjectForKey:", handle);
            ObjC.MessageSend(handle, "release");
        }
Exemplo n.º 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");
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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");
        }
Exemplo n.º 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);
        }
Exemplo n.º 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");
                }
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 11
0
 public UIActionSheet()
 {
     Handle = ObjC.MessageSendIntPtr(Handle, "init");
     ObjC.MessageSend(Handle, "setDelegate:", Handle);
 }
Exemplo n.º 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);
 }
Exemplo n.º 13
0
 public void CancelBannerViewAction()
 {
     ObjC.MessageSend(Handle, "cancelBannerViewAction");
 }
Exemplo n.º 14
0
        public override void Dispose()
        {
            ObjC.MessageSend(Handle, "removeTransactionObserver:", Handle);

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

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