本文整理汇总了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));
}
示例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);
}
示例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);
}
});
}
示例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) => {
//.........这里部分代码省略.........
示例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);
},
}),
};
}
示例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);
}