コード例 #1
0
 public XamCore.CoreAnimation.CADisplayLink CreateDisplayLink(NSAction action)
 {
     if (action == null)
         throw new ArgumentNullException ("action");
     var d = new NSActionDispatcher (action);
     return CreateDisplayLink (d, NSActionDispatcher.Selector);
 }
コード例 #2
0
 public ImageLoaderStringElement(string caption,  NSAction tapped, NSUrl imageUrl, UIImage placeholder)
     : base(caption, tapped)
 {
     Placeholder = placeholder;
     ImageUrl = imageUrl;
     this.Accessory = UITableViewCellAccessory.None;
 }
コード例 #3
0
 public static void Transition(UIView fromView, UIView toView, double duration, UIViewAnimationOptions options, NSAction completion)
 {
     TransitionNotify (fromView, toView, duration, options, (x) => {
         if (completion != null)
             completion ();
     });
 }
コード例 #4
0
 public FilterElement(IssuesFiltersViewModel.FilterModel filterModel, NSAction action, Action accessory)
     : base(filterModel.IssueModel.FilterName, action)
 {
     Accessory = UITableViewCellAccessory.DetailButton;
     AccessoryTapped += () => accessory();
     FilterModel = filterModel;
 }
コード例 #5
0
ファイル: CALayer.cs プロジェクト: Anomalous-Software/maccore
		public static CADisplayLink Create (NSAction action)
		{
			var dispatcher = new NSActionDispatcher (action);
			var rv = Create (dispatcher, NSActionDispatcher.Selector);
			rv.dispatcher = dispatcher;
			return rv;
		}
コード例 #6
0
 public static void Invoke(NSAction action)
 {
     if (_app != null)
     {
         _app.InvokeOnMainThread(action);
     }
 }
コード例 #7
0
 public static NSSlider FromTarget(NSAction action)
 {
     var dispatcher = new NSActionDispatcher (action);
     var control = _FromTarget (dispatcher, NSActionDispatcher.Selector);
     control.dispatcher = dispatcher;
     return control;
 }
コード例 #8
0
 public static NSSlider FromValue(double value, double minValue, double maxValue, NSAction action)
 {
     var dispatcher = new NSActionDispatcher (action);
     var control = _FromValue (value, minValue, maxValue, dispatcher, NSActionDispatcher.Selector);
     control.dispatcher = dispatcher;
     return control;
 }
コード例 #9
0
ファイル: NSAlert.cs プロジェクト: Anomalous-Software/monomac
		public void BeginSheet (NSWindow window, NSAction onEnded)
		{
			BeginSheetForResponse (window, r => {
				if (onEnded != null)
					onEnded ();
			});
		}
コード例 #10
0
ファイル: NSAction.cs プロジェクト: officedrop/maccore
        public NSActionDispatcher(NSAction action)
        {
            if (action == null)
                throw new ArgumentNullException ("action");

            this.action = action;
        }
コード例 #11
0
 public FlayoutNavigationItem(string caption, NSAction tapped, UIImage image, string controller)
     : base(caption, tapped, image)
 {
     Controller = controller;
     Image = image;
     Callback = tapped;
 }
コード例 #12
0
 public StyledElement(string caption,  NSAction tapped, UIImage image)
     : base(caption, tapped)
 {
     Init();
     Image = image;
     Accessory = UITableViewCellAccessory.DisclosureIndicator;
 }
コード例 #13
0
 public static void Animate(double duration, NSAction animation, NSAction completion)
 {
     // animation null check will be done in AnimateNotify
     AnimateNotify (duration, animation, (x) => {
         if (completion != null)
             completion ();
     });
 }
コード例 #14
0
 public static void Animate(double duration, double delay, UIViewAnimationOptions options, NSAction animation, NSAction completion)
 {
     // animation null check will be done in AnimateNotify
     AnimateNotify (duration, delay, options, animation, (x) => {
         if (completion != null)
             completion ();
     });
 }
コード例 #15
0
ファイル: Elements.cs プロジェクト: nicwise/londonbikeapp
 public BikeElement(BikeLocation bike, NSAction action)
     : base("","",action)
 {
     Bike = bike;
     Caption = bike.Name;
     Value = GetValueString();
     Accessory = UITableViewCellAccessory.DisclosureIndicator;
 }
コード例 #16
0
ファイル: UIRaisedTabBar.cs プロジェクト: GSerjo/appreciateui
 public UIRaisedTabBar(UIImage normal, UIImage highlighted, NSAction tapped)
     : base()
 {
     normalState = normal;
     highlightedState = highlighted;
     if (tapped != null)
         Tapped += tapped;
 }
コード例 #17
0
        public Token AddTarget(NSAction action)
        {
            if (action == null)
                throw new ArgumentNullException ("action");

            var t = new ParameterlessDispatch (action);
            RegisterTarget (t, Selector.GetHandle (tsel));
            return t;
        }
コード例 #18
0
		public BadgeElement (UIImage badgeImage, string cellText, NSAction tapped) : base (cellText)
		{
			if (badgeImage == null)
				throw new ArgumentNullException ("badgeImage");
			
			image = badgeImage;
			if (tapped != null)
				Tapped += tapped;
		}		
コード例 #19
0
        public static NSThread Start(NSAction action)
        {
            if (action == null) {
                throw new ArgumentNullException ("action");
            }

            var thread = new ActionThread (action);
            thread.Start ();
            return thread;
        }
コード例 #20
0
		public static void InvokeInBackground (NSAction action)
		{
			// using the parameterized Thread.Start to avoid capturing
			// the 'action' parameter (it'll needlessly create an extra
			// object).
			new System.Threading.Thread ((v) =>
			{
				((NSAction) v) ();
			})
			{
				IsBackground = true,
			}.Start (action);
		}
コード例 #21
0
ファイル: ButtonElement.cs プロジェクト: rsatter/MonoCross
        public ButtonElement(string caption, NSAction tapped)
            : base(caption)
        {
            this.tapped = tapped;

            NormalColor = UIColor.Gray;
            NormalTextColor = UIColor.Black;

            HighlightedColor = UIColor.Blue;
            HighlightedTextColor = UIColor.White;

            DisabledColor = UIColor.Gray;
            DisabledTextColor = UIColor.DarkGray;
        }
コード例 #22
0
ファイル: Main.cs プロジェクト: kellabyte/TweetStation
        public void AddAccount(DialogViewController dvc, NSAction action)
        {
            var oauth = new OAuthAuthorizer (TwitterAccount.OAuthConfig);

            if (useXauth)
                NewAccountXAuth (dvc, action);
            else {
                if (oauth.AcquireRequestToken ()){
                    oauth.AuthorizeUser (dvc, delegate {
                        SetDefaultAccount (oauth);
                        action ();
                    });
                }
            }
        }
コード例 #23
0
ファイル: ElementBadge.cs プロジェクト: 284247028/MvvmCross
		public BadgeElement (UIImage badgeImage, string cellText, NSAction tapped) 
            : base (cellText)
		{
            LineBreakMode = UILineBreakMode.TailTruncation;
            ContentMode = UIViewContentMode.Left;
            Lines = 1;
            Accessory = UITableViewCellAccessory.None;

            if (badgeImage == null)
				throw new ArgumentNullException ("badgeImage");
			
			_image = badgeImage;

			if (tapped != null)
				Tapped += tapped;
		}		
コード例 #24
0
		private RootElement GetRoot()
		{
			IList<Series> coll = AppManifest.Current.Collections;
			
			var root = new RootElement("Collections");
			var section = new Section();
			
			for(var i = 0; i < coll.Count; i++)
			{
				Series series = coll[i];
				var rounded = ImageFactory.LoadRoundedThumbnail(series.Pieces[0]);
				var viewAction = new NSAction(() => { LoadSeries (series); });
				
				var element = new StyledStringElement(series.Title, viewAction) { Image = rounded };
				element.New = series.New.GetValueOrDefault();
				section.Add(element);
			}
			
			root.Add(section);			
			return root;
		}
コード例 #25
0
		private RootElement GetRoot()
		{
			IList<Piece> pieces = _parent.Series.Pieces;			
						
			var root = new RootElement("");
			_section = new Section(string.Concat(_parent.Series.Title, " (", _parent.Series.Years , ")"));
									
			for(var i = 0; i < pieces.Count; i++)
			{
				var page = i;
				var piece = pieces[page];
				
				var viewAction = new NSAction(() =>
				{
					GoToPage(page);
				});				
				
				var element = new StyledStringElement(piece.Title, viewAction);		
				element.Activity = true;
				_section.Add(element);
								
				ThreadPool.QueueUserWorkItem(s =>
				{
					var rounded = ImageFactory.LoadRoundedThumbnail(piece);
					InvokeOnMainThread(()=>
					{
						element.Image = rounded;	
						element.Reload();
					});
				});											
			}
						
			// Set the default check box
			CheckPiece(0);
			root.Add(_section);		
			
			View.SetNeedsDisplay();
			return root;
		}
コード例 #26
0
 public StyledStringElement(string caption, NSAction tapped) : base(caption, tapped)
 {
 }
コード例 #27
0
 public Element(string caption, NSAction tapped)
 {
     this.Caption = caption;
     Tapped      += tapped;
 }
コード例 #28
0
 public UITapGestureRecognizer(NSAction action) : base(action)
 {
 }
コード例 #29
0
ファイル: AppDelegate.cs プロジェクト: nagyist/iOSHelpers
 public override void HandleEventsForBackgroundUrl(UIApplication application, string sessionIdentifier, NSAction completionHandler)
 {
     Console.WriteLine("HandleEventsForBackgroundUrl");
     BackgroundDownload.BackgroundSessionCompletionHandler = completionHandler;
 }
コード例 #30
0
 public Dispatcher(NSAction action)
 {
     this.action = action;
 }
コード例 #31
0
 public StyledStringElement(string caption, NSAction tapped) : base(caption, tapped)
 {
     style = UITableViewCellStyle.Value1;
 }
コード例 #32
0
        void Populate(object callbacks, object o, RootElement root)
        {
            MemberInfo last_radio_index = null;
            var        members          = o.GetType().GetMembers(BindingFlags.DeclaredOnly | BindingFlags.Public |
                                                                 BindingFlags.NonPublic | BindingFlags.Instance
                                                                 );

            Section section = null;

            foreach (var mi in members)
            {
                Type mType = GetTypeForMember(mi);

                if (mType == null)
                {
                    continue;
                }

                string caption = null;
                //string key = null; // l18n
                object [] attrs    = mi.GetCustomAttributes(false);
                bool      skip     = false;
                bool      localize = false;
                foreach (var attr in attrs)
                {
                    if (attr is LocalizeAttribute)
                    {
                        localize = true;
                        break;
                    }
                }
                foreach (var attr in attrs)
                {
                    if (attr is SkipAttribute || attr is System.Runtime.CompilerServices.CompilerGeneratedAttribute)
                    {
                        skip = true;
                    }
                    else if (attr is CaptionAttribute)
                    {
                        caption = ((CaptionAttribute)attr).Caption;
                        if (localize)
                        {
                            caption = NSBundle.MainBundle.LocalizedString(caption, caption);
                        }
                    }
                    else if (attr is SectionAttribute)
                    {
                        if (section != null)
                        {
                            root.Add(section);
                        }
                        var sa     = attr as SectionAttribute;
                        var header = sa.Caption;
                        var footer = sa.Footer;
                        if (localize)
                        {
                            header = NSBundle.MainBundle.LocalizedString(header, header);
                            footer = NSBundle.MainBundle.LocalizedString(footer, footer);
                        }
                        section = new Section(header, footer);
                    }
                }
                if (skip)
                {
                    continue;
                }

                if (caption == null)
                {
                    caption = MakeCaption(mi.Name);
                    if (localize)
                    {
                        caption = NSBundle.MainBundle.LocalizedString(caption, caption);
                    }
                }

                if (section == null)
                {
                    section = new Section();
                }

                Element element = null;
                if (mType == typeof(string))
                {
                    PasswordAttribute  pa     = null;
                    AlignmentAttribute align  = null;
                    EntryAttribute     ea     = null;
                    object             html   = null;
                    NSAction           invoke = null;
                    bool multi = false;

                    foreach (object attr in attrs)
                    {
                        if (attr is PasswordAttribute)
                        {
                            pa = attr as PasswordAttribute;
                        }
                        else if (attr is EntryAttribute)
                        {
                            ea = attr as EntryAttribute;
                        }
                        else if (attr is MultilineAttribute)
                        {
                            multi = true;
                        }
                        else if (attr is HtmlAttribute)
                        {
                            html = attr;
                        }
                        else if (attr is AlignmentAttribute)
                        {
                            align = attr as AlignmentAttribute;
                        }

                        if (attr is OnTapAttribute)
                        {
                            string mname = ((OnTapAttribute)attr).Method;

                            if (callbacks == null)
                            {
                                throw new Exception("Your class contains [OnTap] attributes, but you passed a null object for `context' in the constructor");
                            }

                            var method = callbacks.GetType().GetMethod(mname);
                            if (method == null)
                            {
                                throw new Exception("Did not find method " + mname);
                            }
                            invoke = delegate {
                                method.Invoke(method.IsStatic ? null : callbacks, new object [0]);
                            };
                        }
                    }



                    string value = (string)GetValue(mi, o);
                    if (pa != null)
                    {
                        var placeholder = pa.Placeholder;
                        if (localize)
                        {
                            placeholder = NSBundle.MainBundle.LocalizedString(placeholder, placeholder);
                        }
                        element = new EntryElement(caption, placeholder, value, true);
                    }
                    else if (ea != null)
                    {
                        var placeholder = ea.Placeholder;
                        if (localize)
                        {
                            placeholder = NSBundle.MainBundle.LocalizedString(placeholder, placeholder);
                        }
                        element = new EntryElement(caption, placeholder, value)
                        {
                            KeyboardType = ea.KeyboardType, AutocapitalizationType = ea.AutocapitalizationType, AutocorrectionType = ea.AutocorrectionType, ClearButtonMode = ea.ClearButtonMode
                        };
                    }
                    else if (multi)
                    {
                        element = new MultilineElement(caption, value);
                    }
                    else if (html != null)
                    {
                        element = new HtmlElement(caption, value);
                    }
                    else
                    {
                        var selement = new StringElement(caption, value);
                        element = selement;

                        if (align != null)
                        {
                            selement.Alignment = align.Alignment;
                        }
                    }

                    if (invoke != null)
                    {
                        ((StringElement)element).Tapped += invoke;
                    }
                }
                else if (mType == typeof(float))
                {
                    var floatElement = new FloatElement(null, null, (float)GetValue(mi, o));
                    floatElement.Caption = caption;
                    element = floatElement;

                    foreach (object attr in attrs)
                    {
                        if (attr is RangeAttribute)
                        {
                            var ra = attr as RangeAttribute;
                            floatElement.MinValue    = ra.Low;
                            floatElement.MaxValue    = ra.High;
                            floatElement.ShowCaption = ra.ShowCaption;
                        }
                    }
                }
                else if (mType == typeof(bool))
                {
                    bool checkbox = false;
                    foreach (object attr in attrs)
                    {
                        if (attr is CheckboxAttribute)
                        {
                            checkbox = true;
                        }
                    }

                    if (checkbox)
                    {
                        element = new CheckboxElement(caption, (bool)GetValue(mi, o));
                    }
                    else
                    {
                        element = new BooleanElement(caption, (bool)GetValue(mi, o));
                    }
                }
                else if (mType == typeof(DateTime))
                {
                    var  dateTime = (DateTime)GetValue(mi, o);
                    bool asDate = false, asTime = false;

                    foreach (object attr in attrs)
                    {
                        if (attr is DateAttribute)
                        {
                            asDate = true;
                        }
                        else if (attr is TimeAttribute)
                        {
                            asTime = true;
                        }
                    }

                    if (asDate)
                    {
                        element = new DateElement(caption, dateTime);
                    }
                    else if (asTime)
                    {
                        element = new TimeElement(caption, dateTime);
                    }
                    else
                    {
                        element = new DateTimeElement(caption, dateTime);
                    }
                }
                else if (mType.IsEnum)
                {
                    var   csection = new Section();
                    ulong evalue   = Convert.ToUInt64(GetValue(mi, o), null);
                    int   idx      = 0;
                    int   selected = 0;

                    foreach (var fi in mType.GetFields(BindingFlags.Public | BindingFlags.Static))
                    {
                        ulong v = Convert.ToUInt64(GetValue(fi, null));

                        if (v == evalue)
                        {
                            selected = idx;
                        }

                        CaptionAttribute ca = Attribute.GetCustomAttribute(fi, typeof(CaptionAttribute)) as CaptionAttribute;
                        var cap             = ca != null ? ca.Caption : MakeCaption(fi.Name);
                        if (localize)
                        {
                            NSBundle.MainBundle.LocalizedString(cap, cap);
                        }
                        csection.Add(new RadioElement(cap));
                        idx++;
                    }

                    element = new RootElement(caption, new RadioGroup(null, selected))
                    {
                        csection
                    };
                }
                else if (mType == typeof(UIImage))
                {
                    element = new ImageElement((UIImage)GetValue(mi, o));
                }
                else if (typeof(System.Collections.IEnumerable).IsAssignableFrom(mType))
                {
                    var csection = new Section();
                    int count    = 0;

                    if (last_radio_index == null)
                    {
                        throw new Exception("IEnumerable found, but no previous int found");
                    }
                    foreach (var e in (IEnumerable)GetValue(mi, o))
                    {
                        csection.Add(new RadioElement(e.ToString()));
                        count++;
                    }
                    int selected = (int)GetValue(last_radio_index, o);
                    if (selected >= count || selected < 0)
                    {
                        selected = 0;
                    }
                    element = new RootElement(caption, new MemberRadioGroup(null, selected, last_radio_index))
                    {
                        csection
                    };
                    last_radio_index = null;
                }
                else if (typeof(int) == mType)
                {
                    foreach (object attr in attrs)
                    {
                        if (attr is RadioSelectionAttribute)
                        {
                            last_radio_index = mi;
                            break;
                        }
                    }
                }
                else
                {
                    var nested = GetValue(mi, o);
                    if (nested != null)
                    {
                        var newRoot = new RootElement(caption);
                        Populate(callbacks, nested, newRoot);
                        element = newRoot;
                    }
                }

                if (element == null)
                {
                    continue;
                }
                section.Add(element);
                mappings [element] = new MemberAndInstance(mi, o);
            }
            root.Add(section);
        }
コード例 #33
0
 public UIRotationGestureRecognizer(NSAction action) : base(action)
 {
 }
コード例 #34
0
 public GameInstanceElement(NetworkBrowserModel.GameInstanceInfo gameInstanceInfo, NSAction tapped)
     : base(gameInstanceInfo.GameInstance.Name, tapped)
 {
     this.GameInstanceInfo = gameInstanceInfo;
 }
コード例 #35
0
		public void BeginSheet (string directory, string fileName, string []fileTypes, NSWindow modalForWindow, NSAction onEnded)
		{
			var obj = OneShotTracker.Create (onEnded);
			BeginSheet (directory, fileName, fileTypes, modalForWindow, obj, NSActionDispatcher.Selector, IntPtr.Zero);
		}
コード例 #36
0
 public UIPinchGestureRecognizer(NSAction action) : base(action)
 {
 }
コード例 #37
0
 public UIGestureRecognizer(NSAction action) : this(Selector.GetHandle(tsel), new ParameterlessDispatch(action))
 {
 }
コード例 #38
0
ファイル: Util.cs プロジェクト: ghuntley/londonbikeapp
        public static void SendMail(UIViewController parent, string to, string subject, MailAttachment attachment, string body, NSAction onDone)
        {
            if (MFMailComposeViewController.CanSendMail)
            {
                mailCompose = new MFMailComposeViewController();

                mailCompose.SetSubject(subject);
                mailCompose.SetToRecipients(new string[] { to });
                if (attachment != null)
                {
                    NSData att = NSData.FromFile(attachment.Filename);
                    mailCompose.AddAttachmentData(att, attachment.FileType, attachment.EmailFilename);
                }
                mailCompose.SetMessageBody(body, false);
                mailCompose.Finished += delegate(object sender, MFComposeResultEventArgs e) {
                    mailCompose.DismissModalViewControllerAnimated(true);
                    onDone();
                };
                parent.PresentModalViewController(mailCompose, true);
            }
        }
コード例 #39
0
        protected override Task <string> LoginAsyncOverride()
        {
            var tcs = new TaskCompletionSource <string>();

            var auth = new WebRedirectAuthenticator(StartUri, EndUri);

            auth.ClearCookiesBeforeLogin = false;

            UIViewController c = auth.GetUI();

            UIViewController    controller = null;
            UIPopoverController popover    = null;

            auth.Error += (o, e) =>
            {
                NSAction completed = () =>
                {
                    Exception ex = e.Exception ?? new Exception(e.Message);
                    tcs.TrySetException(ex);
                };

                if (controller != null)
                {
                    controller.DismissViewController(true, completed);
                }
                if (popover != null)
                {
                    popover.Dismiss(true);
                    completed();
                }
            };

            auth.Completed += (o, e) =>
            {
                NSAction completed = () =>
                {
                    if (!e.IsAuthenticated)
                    {
                        tcs.TrySetException(new InvalidOperationException(Resources.IAuthenticationBroker_AuthenticationCanceled));
                    }
                    else
                    {
                        tcs.TrySetResult(e.Account.Properties["token"]);
                    }
                };

                if (controller != null)
                {
                    controller.DismissViewController(true, completed);
                }
                if (popover != null)
                {
                    popover.Dismiss(true);
                    completed();
                }
            };

            controller = view as UIViewController;
            if (controller != null)
            {
                controller.PresentViewController(c, true, null);
            }
            else
            {
                UIView          v         = view as UIView;
                UIBarButtonItem barButton = view as UIBarButtonItem;

                popover = new UIPopoverController(c);

                if (barButton != null)
                {
                    popover.PresentFromBarButtonItem(barButton, UIPopoverArrowDirection.Any, true);
                }
                else
                {
                    popover.PresentFromRect(rect, v, UIPopoverArrowDirection.Any, true);
                }
            }

            return(tcs.Task);
        }
コード例 #40
0
 public static Task <bool> AnimateAsync(double duration, NSAction animation)
 {
     return(AnimateNotifyAsync(duration, animation));
 }
コード例 #41
0
        public void BeginSheet(string directory, string fileName, string [] fileTypes, NSWindow modalForWindow, NSAction onEnded)
        {
            var obj = OneShotTracker.Create(onEnded);

            BeginSheet(directory, fileName, fileTypes, modalForWindow, obj, NSActionDispatcher.Selector, IntPtr.Zero);
        }
コード例 #42
0
ファイル: NSObject2.cs プロジェクト: sndipan/xamarin-macios
        public virtual void Invoke(NSAction action, TimeSpan delay)
        {
            var d = new NSAsyncActionDispatcher(action);

            d.PerformSelector(NSActionDispatcher.Selector, null, delay.TotalSeconds);
        }
コード例 #43
0
        public void BeginSheet(NSWindow sheet, NSWindow docWindow, NSAction onEnded)
        {
            var obj = OneShotTracker.Create(onEnded);

            BeginSheet(sheet, docWindow, obj, NSActionDispatcher.Selector, IntPtr.Zero);
        }
コード例 #44
0
ファイル: NSObject2.cs プロジェクト: sndipan/xamarin-macios
        public virtual void Invoke(NSAction action, double delay)
        {
            var d = new NSAsyncActionDispatcher(action);

            d.PerformSelector(NSActionDispatcher.Selector, null, delay);
        }
コード例 #45
0
ファイル: Main.cs プロジェクト: sushmasavekar/Seminars
        void ShowMessage(string caption, string message, NSAction callback = null)
        {
            var alert = new UIAlertView(caption, message, null, "Ok");

            if (callback != null)
            {
                alert.Dismissed += delegate { callback(); }
            }
            ;
            alert.Show();
        }

        void SetupError(string msg)
        {
            ShowMessage("Setup Error", msg, () => { Environment.Exit(1); });
        }

        //
        // This method merely validates that the basic components of a Facebook
        // app are complete, it should not be needed in a complete application,
        // but will help in the first stages of debugging your Facebook
        // interop
        //
        void ValidateSetup()
        {
            if (AppId == null)
            {
                SetupError("Missing AppId,  You can not run the app until this is setup");
            }

            // Validate the callback "fb[APPID]://authorize is in the Info.plist
            // which is what facebook uses to call us back
            bool urlFound = false;

            try {
                var arr = NSArray.FromArray <NSObject> (NSBundle.MainBundle.ObjectForInfoDictionary("CFBundleURLTypes") as NSArray);
                if (arr != null && arr.Length > 0)
                {
                    var dict = arr [0] as NSDictionary;
                    arr = NSArray.FromArray <NSString> (dict [(NSString)"CFBundleURLSchemes"] as NSArray);
                    if (arr != null && arr.Length > 0)
                    {
                        var fbvalue = arr [0].ToString();
                        if (fbvalue.StartsWith("fb" + AppId))
                        {
                            urlFound = true;
                        }
                    }
                }
                else
                {
                    SetupError("Missing fbXXXX URL handler in Info.plist's CFBundleURLTypes section");
                }
            } catch {
                SetupError("Invalid contents of Info.plist file");
            }

            if (!urlFound)
            {
                SetupError("Missing correct fbXXXX i the Info.plist's setup");
            }

            // Check if the authorization callback will work
            if (!UIApplication.SharedApplication.CanOpenUrl(new NSUrl("fb" + AppId + "://authorize")))
            {
                SetupError("Invalid or missing URL scheme. You cannot run the app until you set up a valid URL scheme in your .plist.");
            }
        }
コード例 #46
0
 public override void PresentViewController(UIViewController viewControllerToPresent, bool animated, NSAction completionHandler)
 {
     base.PresentViewController(viewControllerToPresent, animated, completionHandler);
 }
コード例 #47
0
ファイル: Extra.cs プロジェクト: udiidan/monotouch-bindings
 public CCTimer(NSAction target) : this(new NSActionDispatcher(target), NSActionDispatcher.Selector)
 {
 }
コード例 #48
0
 public UILongPressGestureRecognizer(NSAction action) : base(action)
 {
 }
コード例 #49
0
ファイル: Extra.cs プロジェクト: udiidan/monotouch-bindings
 public CCCallFunc(NSAction callback) : this(new NSActionDispatcher(callback), NSActionDispatcher.Selector)
 {
 }
コード例 #50
0
 public static void Transition(UIView withView, double duration, UIViewAnimationOptions options, NSAction animation, NSAction completion)
 {
     // animation null check will be done in AnimateNotify
     TransitionNotify(withView, duration, options, animation, (x) => {
         if (completion != null)
         {
             completion();
         }
     });
 }
コード例 #51
0
 public static void Transition(UIView fromView, UIView toView, double duration, UIViewAnimationOptions options, NSAction completion)
 {
     TransitionNotify(fromView, toView, duration, options, (x) => {
         if (completion != null)
         {
             completion();
         }
     });
 }
コード例 #52
0
 public static void Animate(double duration, double delay, UIViewAnimationOptions options, NSAction animation, NSAction completion)
 {
     // animation null check will be done in AnimateNotify
     AnimateNotify(duration, delay, options, animation, (x) => {
         if (completion != null)
         {
             completion();
         }
     });
 }
コード例 #53
0
 public UISwipeGestureRecognizer(NSAction action) : base(action)
 {
 }
コード例 #54
0
ファイル: ValueElement.cs プロジェクト: moljac/Android.Dialog
 protected ValueElement(string caption, NSAction tapped)
     : base(caption, tapped)
 {
 }
コード例 #55
0
		public void BeginSheet (NSPrintInfo printInfo, NSWindow docWindow, NSAction onEnded)
		{
			var obj = OneShotTracker.Create (onEnded);
			BeginSheet (printInfo, docWindow, obj, NSActionDispatcher.Selector, IntPtr.Zero);
		}
コード例 #56
0
 public UIScreenEdgePanGestureRecognizer(NSAction action) : base(action)
 {
 }
コード例 #57
0
		public CustomImageStringElement (string caption, NSAction tapped, UIImage image) : base (caption, tapped, image)
		{
			_image = image;
		}		
コード例 #58
0
 internal ParameterlessDispatch(NSAction action)
 {
     this.action = action;
 }
コード例 #59
0
ファイル: NSAction.cs プロジェクト: kangaroo/maccore
 public NSActionDispatcher(NSAction action)
 {
     this.action = action;
 }
コード例 #60
0
        public void TransitionOutCompletion(NSAction action)
        {
            switch (this.TransitionStyle)
            {
            case SIAlertViewTransitionStyle.SlideFromBottom:
            {
                RectangleF rect      = this._ContainerView.Frame;
                var        locationY = this.Bounds.Size.Height;
                rect = new RectangleF(rect.Location.X, locationY, rect.Size.Width, rect.Size.Height);
                UIView.Animate(
                    duration: 0.3f,
                    delay: 0f,
                    options: UIViewAnimationOptions.CurveEaseIn,
                    animation: () => { this._ContainerView.Frame = rect; },
                    completion: () => { if (action != null)
                                        {
                                            action.Invoke();
                                        }
                    });
            }
            break;

            case SIAlertViewTransitionStyle.SlideFromTop:
            {
                RectangleF rect      = this._ContainerView.Frame;
                var        locationY = -rect.Size.Height;
                rect = new RectangleF(rect.Location.X, locationY, rect.Size.Width, rect.Size.Height);
                UIView.Animate(
                    duration: 0.3f,
                    delay: 0f,
                    options: UIViewAnimationOptions.CurveEaseIn,
                    animation: () => { this._ContainerView.Frame = rect; },
                    completion: () => { if (action != null)
                                        {
                                            action.Invoke();
                                        }
                    });
            }
            break;

            case SIAlertViewTransitionStyle.Fade:
            {
                UIView.Animate(
                    duration: 0.25f,
                    delay: 0f,
                    options: UIViewAnimationOptions.CurveEaseIn,
                    animation: () => { this._ContainerView.Alpha = 0f; },
                    completion: () => { if (action != null)
                                        {
                                            action.Invoke();
                                        }
                    });
            }
            break;

            //case SIAlertViewTransitionStyle,Bounce:
            //{
            //    CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"];
            //    animation.values = @[@(1), @(1.2), @(0.01)];
            //    animation.keyTimes = @[@(0), @(0.4), @(1)];
            //    animation.timingFunctions = @[[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]];
            //    animation.duration = 0.35;
            //    animation.delegate = self;
            //    [animation setValue:completion forKey:@"handler"];
            //    [self.containerView.layer addAnimation:animation forKey:@"bounce"];

            //    self.containerView.transform = CGAffineTransformMakeScale(0.01, 0.01);
            //}
            //    break;

            case SIAlertViewTransitionStyle.DropDown:
            {
                PointF point    = this._ContainerView.Center;
                PointF newPoint = new PointF(point.X, point.Y + this.Bounds.Size.Height);
                UIView.Animate(
                    duration: 0.3f,
                    delay: 0f,
                    options: UIViewAnimationOptions.CurveEaseIn,
                    animation: () =>
                    {
                        this._ContainerView.Center = newPoint;
                        float angle = GetRandomAngle();
                        this._ContainerView.Transform = CGAffineTransform.MakeRotation(angle);
                    },
                    completion: () => { if (action != null)
                                        {
                                            action.Invoke();
                                        }
                    });
            }
            break;

            default:
                break;
            }
        }