当前位置: 首页>>代码示例>>C#>>正文


C# UIPopoverController.Dispose方法代码示例

本文整理汇总了C#中UIPopoverController.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# UIPopoverController.Dispose方法的具体用法?C# UIPopoverController.Dispose怎么用?C# UIPopoverController.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UIPopoverController的用法示例。


在下文中一共展示了UIPopoverController.Dispose方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NumberEntryView

        public NumberEntryView()
        {
            BackgroundColor = UIColor.White;
            BorderStyle = UITextBorderStyle.RoundedRect;
            this.KeyboardType = UIKeyboardType.DecimalPad;
            this.ShouldBeginEditing = (t) =>{
                if(UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone || popover != null && popover.PopoverVisible)
                    return true;
                var num = new NumberInputViewController(this);
                popover = new UIPopoverController(num){

                };
                popover.PresentFromRect(this.Frame,this.Superview, UIPopoverArrowDirection.Any,true);
                popover.DidDismiss += (object sender, EventArgs e) => {
                    this.ResignFirstResponder();
                    popover.Dispose();
                    num.Dispose();
                    popover = null;
                };

                this.SelectAll(this);
                return true;
            };
            this.EditingDidEnd += (s,e) => {
                if(NewValue != null)
                    NewValue(Text);
                if(popover != null && popover.PopoverVisible)
                    popover.Dismiss(true);
            };
            this.InputView = new UIView (new RectangleF (0, 0, 0, 0));
        }
开发者ID:nagyist,项目名称:iPadPos,代码行数:31,代码来源:NumberEntryView.cs

示例2: InvoiceLineCell

        public InvoiceLineCell()
            : base(Key)
        {
            AutoAddSubview (Description = new UILabel {
                Text = "Description",
            }, 4
            );

            AutoAddSubview (Price = new UILabel{ Text = "Price",TextAlignment = UITextAlignment.Center },2);
            AutoAddSubview (Discount = new UIBorderedButton () {
                Title = "0",
                Tapped = (b) =>{

                    if(popup != null)
                        popup.Dispose();

                    var d = new DiscountViewController(line.Price){
                        DollarChanged = (dollar) =>{
                            popup.Dismiss(true);
                            Line.Discount = dollar;
                        }
                    };

                    popup = new UIPopoverController(d);
                    popup.DidDismiss += (object sender, EventArgs e) => {
                        line.Discount = 0;
                        d.Dispose();
                        popup.Dispose();
                        popup = null;
                    };
                    popup.PresentFromRect(Discount.Bounds,Discount, UIPopoverArrowDirection.Any,true);
                }},2);

            AutoAddSubview (TransTypeButton = new UIBorderedButton{ Title = "S" ,TintColor = Color.LightBlue});
            TransTypeButton.TouchUpInside += (sender, e) => {
                var sheet = new SimpleActionSheet();
                var types = Database.Main.Table<TransactionType>().ToList();
                types.ForEach(x=> sheet.Add(x.Description,Color.LightBlue,()=> Line.TransType = x));
                sheet.ShowFrom(TransTypeButton.Bounds,TransTypeButton,true);
            };
            AddSubview (Total = new UILabel{ Text = "Total",TextAlignment = UITextAlignment.Center },9,columnspan:2);
        }
开发者ID:nagyist,项目名称:iPadPos,代码行数:42,代码来源:InvoiceLineCell.cs

示例3: ShowImagePickerView

        private void ShowImagePickerView()
        {
            UIApplication.SharedApplication.InvokeOnMainThread (delegate {
                UIImagePickerController imagePickerController = new UIImagePickerController();
                imagePickerController.FinishedPickingImage += HandleImagePickerControllerFinishedPickingImage;
                imagePickerController.FinishedPickingMedia += HandleImagePickerControllerFinishedPickingMedia;
                imagePickerController.Canceled += HandleImagePickerControllerCanceled;

                if(IPhoneUtils.GetInstance().IsIPad()) {
                    try {

                        // in iPad, the UIImagePickerController should be presented inside a UIPopoverController, otherwise and exception is raised
                        popover = new UIPopoverController(imagePickerController);
                        UIView view = IPhoneServiceLocator.CurrentDelegate.MainUIViewController ().View;
                        //RectangleF frame = new RectangleF(new PointF(0,0),new SizeF(view.Frame.Size.Width, view.Frame.Size.Height));
                        RectangleF frame = new RectangleF(new PointF(0,0),new SizeF(0,0));
                        popover.PresentFromRect(frame, view, UIPopoverArrowDirection.Up, true);

                    }catch(Exception ex) {
                        INotification notificationService = (INotification)IPhoneServiceLocator.GetInstance ().GetService ("notify");
                        if (notificationService != null) {
                            notificationService.StartNotifyAlert ("Media Alert", "Unable to reach Photo Library", "OK");
                        }
                        if(popover != null && popover.PopoverVisible) {
                            popover.Dismiss(true);
                            popover.Dispose();
                        }
                    }

                } else {
                    IPhoneServiceLocator.CurrentDelegate.MainUIViewController ().PresentModalViewController (imagePickerController, true);
                }
            });
        }
开发者ID:jioe,项目名称:appverse-mobile,代码行数:34,代码来源:IPhoneMedia.cs

示例4: InvoiceViewController

		public InvoiceViewController ()
		{
			SetTitle ();
			Settings.Shared.SubscribeToProperty ("TestMode", SetTitle);
			var searchBar = new ItemSearchView{ Frame = new System.Drawing.RectangleF (0, 0, 200, 30) };
			searchBar.ItemSelected += (Item obj) => {
				Invoice.AddItem (obj);
			};
			NavigationItem.RightBarButtonItem = new UIBarButtonItem (searchBar);
			NavigationItem.LeftBarButtonItem = new UIBarButtonItem (UIImage.FromBundle ("menu").ImageWithRenderingMode (UIImageRenderingMode.AlwaysTemplate), UIBarButtonItemStyle.Plain, (s, e) => {
				//Show simple actionsheet
				if (sheet != null) {
					sheet.DismissWithClickedButtonIndex (-1, true);
					return;
				}
				sheet = new SimpleActionSheet { 
					{"New Invoice",async() =>{
							if(await AskSave())
								NewInvoice();
						}
					},
					{"Load Invoice",() => {
							if(popover != null)
							{
								popover.Dismiss(true);
							}
							popover = new UIPopoverController(new UINavigationController(new LoadInvoiceViewController(){
								InvoiceSelected = async (i) =>{
									popover.Dismiss(true);
									try{
										BigTed.BTProgressHUD.ShowContinuousProgress();
										if(Invoice != null && Invoice.Id != i.Id)
										{
											if(!await AskSave())
												return;
										}
										Invoice.DeleteLocal();
										Invoice = await WebService.Main.GetInvoice(i.Id);
										Invoice.Save(true);
									}
									catch(Exception ex)
									{
										Console.WriteLine(ex);
									}
									finally{
										BigTed.BTProgressHUD.Dismiss();
									}
								},
							}));
							popover.DidDismiss += (sender,  evt) => {
								popover.Dispose();
							};
							popover.PresentFromBarButtonItem(NavigationItem.LeftBarButtonItem, UIPopoverArrowDirection.Any,true);
						}
					},
					{"Payout Buy",() => {
							if(popover != null)
							{
								popover.Dismiss(true);
							}
							popover = new UIPopoverController(new UINavigationController(new LoadBuyPayoutViewController(){
								InvoiceSelected = async (i) =>{
									popover.Dismiss(true);
									try{
										BigTed.BTProgressHUD.ShowContinuousProgress();
										if(Invoice != null && Invoice.Id != i.Id)
										{
											if(!await AskSave())
												return;
										}
										Invoice.DeleteLocal();
										Invoice = await WebService.Main.GetInvoice(i.Id);
										//Setup payments
										Database.Main.Table<PaymentType> ().Where (x => x.IsActive)
											.OrderBy (X => X.SortOrder).ToList ().ForEach (x => Invoice.Payments.Add (new Payment{ PaymentType = x }));
										Invoice.Save(true);
										if((i as BuyInvoice).IsOnAccount)
											Invoice.OnAccountPayment.Amount = Invoice.Total;
										else
											Invoice.CashPayment.Amount = Invoice.Total;
									}
									catch(Exception ex)
									{
										Console.WriteLine(ex);
									}
									finally{
										BigTed.BTProgressHUD.Dismiss();
									}
								},
							}));
							popover.DidDismiss += (sender,  evt) => {
								popover.Dispose();
							};
							popover.PresentFromBarButtonItem(NavigationItem.LeftBarButtonItem, UIPopoverArrowDirection.Any,true);

						}
					},
					{"Settings",() => this.PresentViewControllerAsync (new UINavigationController (new SettingsViewController ()), true)},
				};
				sheet.Dismissed += (object sender, UIButtonEventArgs e2) => {
//.........这里部分代码省略.........
开发者ID:nagyist,项目名称:iPadPos,代码行数:101,代码来源:InvoiceViewController.cs

示例5: InvoiceSideBar

        public InvoiceSideBar()
        {
            this.Layer.BorderColor = UIColor.Black.ColorWithAlpha (.25f).CGColor;
            this.Layer.BorderWidth = .5f;
            BackgroundColor = Theme.Current.SideBarBackGroundColor;//UIColor.DarkGray;
            AddSubview (tableView = new UITableView (RectangleF.Empty, UITableViewStyle.Grouped) {
                BackgroundColor = UIColor.Clear,
                Source = source = new CellTableViewSource {
                    (customer = new CustomerPickerCell {
                        Tapped = async () => {
                            CustomerSearchViewController customerSearch;
                            popover = new UIPopoverController (new UINavigationController (customerSearch = new CustomerSearchViewController {
                                CustomerPicked = (c) => {
                                    Invoice.Customer = c;
                                    popover.Dismiss (true);
                                    popover.Dispose ();
                                    if(Invoice.Customer.IsNew)
                                    {
                                        //
                                        NewCustomerInfoViewController newCust;
                                        newCustPopover = new UIPopoverController(new UINavigationController(newCust = new NewCustomerInfoViewController()));
                                        newCust.Popover = newCustPopover;
                                        newCust.HowTheyHeard = (i) => {
                                            invoice.AddItem(i);
                                            newCustPopover.Dismiss(true);
                                            newCustPopover.Dispose();
                                        };
                                        newCustPopover.PresentFromRect (customer.Frame, tableView, UIPopoverArrowDirection.Right, true);

                                        //
                                    }
                                }
                            }) {
                                NavigationBar = {
                                    BarStyle = UIBarStyle.BlackTranslucent,
                                }
                            });
                            customerSearch.Popover = popover;
                            popover.PresentFromRect (customer.Frame, tableView, UIPopoverArrowDirection.Right, true);
                        }
                    }),
                    (subtotal = new SubTotalCell ()),
                    (discount = new DiscountCell {
                        AddDiscount = () =>{

                        }
                    }),
                    (total = new TotalCell ()),
                    new PayCell {
                        Frame = new RectangleF(0,0,320,60),
                        Text = "Checkout",
                        TintColor = UIColor.White,
                        Tapped = () => {
                            Checkout ();
                        }
                    }, (lastPostedChange = new LastPostedCell () {

                    }),
                    (printLastInvoice = new PrintLastInvoiceCell{
                        Text = "Print last invoice",
                        Tapped = ()=>{
                            WebService.Main.PrintInvoice(Settings.Shared.LastPostedInvoice);
                        }
                    }),
                },
                ScrollEnabled = false,
                TableHeaderView = new UIView (new RectangleF (0, 0, 0, 64)),
            });
            Binding.Create (() => lastPostedChange.DetailTextLabel.Text == Settings.Shared.LastPostedChangeString);
            customerInfo = new UITableViewCell[] {
                (email = new MiniCell {
                    TextLabel = {
                        Text = "Email"
                    },
                    Tapped = ()=>{
                        showEditor(email);
                    },
                }),
                (phoneNumber = new MiniCell {
                    TextLabel = {
                        Text = "Phone"
                    },
                    Tapped = ()=>{
                        showEditor(phoneNumber);
                    },
                }),
                (onAccount = new MiniCell {
                    TextLabel = {
                        Text = "On Account"
                    },
                    Tapped = ()=>{
                        showEditor(onAccount);
                    },
                }),
            };
        }
开发者ID:nagyist,项目名称:iPadPos,代码行数:96,代码来源:InvoiceSideBar.cs

示例6: Selected

        public override void Selected(DialogViewController dvc, UITableView tableView, NSIndexPath path)
        {
            picker = new DatePickerController (DateValue);
            popover = new UIPopoverController (new UINavigationController (picker));
            picker.ContentSizeForViewInPopover = DatePickerSize;
            picker.DatePicked += OnDatePicked;
            picker.Popover = popover;

            var cell = GetActiveCell ();

            popover.DidDismiss += (sender, e) => {
                popover.Dispose ();
                popover = null;
                picker.Dispose ();
                picker = null;
            };

            popover.PresentFromRect (cell.Frame, tableView, UIPopoverArrowDirection.Up, true);
        }
开发者ID:Clancey,项目名称:FlightLog,代码行数:19,代码来源:FlightDateEntryElement.cs


注:本文中的UIPopoverController.Dispose方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。