• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# UIActionSheet类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中UIActionSheet的典型用法代码示例。如果您正苦于以下问题:C# UIActionSheet类的具体用法?C# UIActionSheet怎么用?C# UIActionSheet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



UIActionSheet类属于命名空间,在下文中一共展示了UIActionSheet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: HandleBtnSimpleActionSheetTouchUpInside

		protected void HandleBtnSimpleActionSheetTouchUpInside (object sender, EventArgs e)
		{
			// create an action sheet using the qualified constructor
			actionSheet = new UIActionSheet ("simple action sheet", null, "cancel", "delete", null);
			actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) { Console.WriteLine ("Button " + b.ButtonIndex.ToString () + " clicked"); };
			actionSheet.ShowInView (View);
		}
开发者ID:Adameg,项目名称:mobile-samples,代码行数:7,代码来源:ActionSheets_iPad.xib.cs


示例2: HandleButtonTrashClicked

		void HandleButtonTrashClicked (object sender, EventArgs e)
		{
			string filepath = Path.Combine(Environment.GetFolderPath (Environment.SpecialFolder.Personal), _filename);
			if(File.Exists(filepath))
			{
				var actionSheet = new UIActionSheet("") {Utils.Translate("delete"), Utils.Translate("cancel")};
				actionSheet.Title =  Utils.Translate("confirmdeleteimage");
				actionSheet.DestructiveButtonIndex = 0;
				actionSheet.CancelButtonIndex = 1;
				actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
				
				actionSheet.Clicked += delegate(object s, UIButtonEventArgs evt) {
					switch (evt.ButtonIndex)
					{
					case 0:
						//Slett
						File.Delete(filepath);
						_filename = string.Empty;
						imageView.Image = null;
						_callback(this);
						NavigationController.PopViewControllerAnimated(true);
						break;
					case 1:
						//Avbryt
						break;
					}
				};
			}
		}
开发者ID:darkwood,项目名称:Jaktloggen,代码行数:29,代码来源:FieldImagePickerScreen.xib.cs


示例3: HandleBtnSimpleActionSheetTouchUpInside

		void HandleBtnSimpleActionSheetTouchUpInside (object sender, EventArgs e)
		{
			// create an action sheet using the qualified constructor
			actionSheet = new UIActionSheet ("simple action sheet", null, "cancel", "delete", null);
			actionSheet.Clicked += OnClicked;
			actionSheet.ShowInView (View);
		}
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:7,代码来源:ActionSheets_iPhone.xib.cs


示例4: Clicked

        public override void Clicked(UIActionSheet actionview, int buttonIndex)
        {
            if (buttonIndex == 0)
            {
                Console.Write("Satya!!!!!!");

                /*UIActivityIndicatorView spinner = new UIActivityIndicatorView(new RectangleF(0,0,200,300));
                spinner.ActivityIndicatorViewStyle = UIActivityIndicatorViewStyle.WhiteLarge;
                spinner.Center= new PointF(160, 140);
                spinner.HidesWhenStopped = true;
                actionview.AddSubview(spinner);
                InvokeOnMainThread(delegate() {
                    spinner.StartAnimating();
                });

                */

                var documents = Environment.GetFolderPath (Environment.SpecialFolder.MyDocuments);

                fileName = documents + "/" + fileName;

                data = NSData.FromUrl(_nsurl);
                File.WriteAllBytes(fileName,data.ToArray());

                if (File.Exists(fileName))
                {
                    UIAlertView alert = new UIAlertView();
                    alert.Title = "Download Complete";
                    alert.AddButton("Done");
                    alert.Show();
                }
                    //spinner.StopAnimating();

            }
        }
开发者ID:satendra4u,项目名称:LittelfuseCatalogs,代码行数:35,代码来源:MyActionSheetViewDelegate.cs


示例5: HandleBtActionClicked

		void HandleBtActionClicked (object sender, EventArgs e)
		{
			var actionSheet = new UIActionSheet("") {"Del på facebook", "Send link på e-post", Utils.Translate("cancel")};
			actionSheet.Title = "Del denne siden";
			//actionSheet.DestructiveButtonIndex = 0;
			actionSheet.CancelButtonIndex = 2;
			actionSheet.ShowInView(this.View);
			
			actionSheet.Clicked += delegate(object s, UIButtonEventArgs evt) 
			{
				switch (evt.ButtonIndex)
				{
				case 0:
					//Del på facebook
					
					break;
				case 1:
					//Send link på e-post
					var url = webView.Request.MainDocumentURL;
					var htmlstr ="<a href='"+url+"'>"+url+"</a>";
					var reportScreen = new ReportJakt(htmlstr);
					this.NavigationController.PushViewController(reportScreen, true);
					break;
				/*case 2:
					//Del på face
					MessageBox.Show("Ennå ikke implementert...", "");
					break;
				*/default:
					//Avbryt
					
					break;
				}
			};
		}
开发者ID:darkwood,项目名称:Jaktloggen,代码行数:34,代码来源:WebScreen.cs


示例6: ViewDidLoad

 public override void ViewDidLoad ()
 {
     base.ViewDidLoad ();
     
     _picker = new UIImagePickerController ();
     _pickerDel = new PickerDelegate (this);
     _picker.Delegate = _pickerDel;
     
     _actionSheet = new UIActionSheet ();
     _actionSheet.AddButton ("Library");
     _actionSheet.AddButton ("Camera");
     _actionSheet.AddButton ("Cancel");
     _actionSheet.CancelButtonIndex = 2;
     _actionSheet.Delegate = new ActionSheetDelegate (this);
     
     showPicker.TouchUpInside += delegate { _actionSheet.ShowInView (this.View); };
     
     playMovie.Hidden = true;
     
     playMovie.TouchUpInside += delegate {
         if (_mp != null) {
             View.AddSubview (_mp.View);
             _mp.SetFullscreen (true, true);
             _mp.Play ();
         }
     };
 }
开发者ID:enricos,项目名称:learning_monotouch_code,代码行数:27,代码来源:CameraDemoController.xib.cs


示例7: PickRegisterOption

		private void PickRegisterOption()
		{
			try {
				UIActionSheet actionSheet;
				actionSheet = new UIActionSheet();

				actionSheet.AddButton("Phone");
				actionSheet.AddButton("Email");		

				actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) {
					if (b.ButtonIndex == (0)) {
						EmailRegisterView.Hidden = true;
						PhoneRegisterView.Hidden = false;
						SetEditing(false, true);
						this.registerMode = this.appDelegate.MODE_REGISTER_PHONE;
					} else {
						EmailRegisterView.Hidden = false;
						PhoneRegisterView.Hidden = true;
						this.registerMode = this.appDelegate.MODE_REGISTER_EMAIL;
						SetEditing(false, true);
					} 
				};
				actionSheet.ShowInView(View);
			} catch (Exception ex) {
				Console.Write(ex.Message);
			}
		}
开发者ID:Securecom,项目名称:Securecom-Messaging-iOS,代码行数:27,代码来源:RegistrationView.cs


示例8: LoadView

		public override void LoadView ()
		{
			NavigationItem.RightBarButtonItem= new UIBarButtonItem(UIBarButtonSystemItem.Compose,
				delegate {
					var actionSheet = new UIActionSheet ("Email", null, "Cancel", "PNG", "PDF"){
						Style = UIActionSheetStyle.Default
					};

					actionSheet.Clicked += delegate (object sender, UIButtonEventArgs args){

						if(args.ButtonIndex > 1)
							return;

						Email(args.ButtonIndex == 0 ? "png" : "pdf");
					};

					actionSheet.ShowInView (View);
				});

			var scrollView = new GraphScrollView(exampleInfo,
			                 new RectangleF(new PointF(0, 0),
			               new SizeF(UIScreen.MainScreen.ApplicationFrame.Size.Width,
			          UIScreen.MainScreen.ApplicationFrame.Height -
			          UIScreen.MainScreen.ApplicationFrame.Top - 10)));
			View = scrollView;
		}
开发者ID:aleksanderkobylak,项目名称:oxyplot,代码行数:26,代码来源:GraphViewController.cs


示例9: RightBarButtonClicked

		private void RightBarButtonClicked(object sender, EventArgs args)
		{
			var actionSheet = new UIActionSheet("") {Utils.Translate("email.sendbymail"), Utils.Translate("cancel")};
			actionSheet.Title = Utils.Translate("actionsheet.reportheader");
			//actionSheet.DestructiveButtonIndex = 0;
			actionSheet.CancelButtonIndex = 2;
			actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
			
			actionSheet.Clicked += delegate(object s, UIButtonEventArgs e) 
			{
				switch (e.ButtonIndex)
				{
				case 0:
					//Enkel rapport
					var reportScreen = new ReportJakt(jakt);
					this.NavigationController.PushViewController(reportScreen, true);
					break;
				/*case 1:
					//Jaktbok
					var uploadScreen = new UploadScreen(jakt);
					this.NavigationController.PushViewController(uploadScreen, true);
					break;
				case 2:
					//Del på face
					MessageBox.Show("Ennå ikke implementert...", "");
					break;
				*/default:
					//Avbryt
					
					break;
				}
			};
			
		}
开发者ID:darkwood,项目名称:Jaktloggen,代码行数:34,代码来源:JaktItemScreen.xib.cs


示例10: Clicked

 public override void Clicked(UIActionSheet actionSheet, int buttonIndex)
 {
     switch (buttonIndex)
     {
     case 0:
         MoveVerseToCategory (Category.Sunday);
         break;
     case 1:
         MoveVerseToCategory (Category.Monday);
         break;
     case 2:
         MoveVerseToCategory (Category.Tuesday);
         break;
     case 3:
         MoveVerseToCategory (Category.Wednesday);
         break;
     case 4:
         MoveVerseToCategory (Category.Thursday);
         break;
     case 5:
         MoveVerseToCategory (Category.Friday);
         break;
     case 6:
         MoveVerseToCategory (Category.Saturday);
         break;
     case 7:
         MoveVerseToCategory (Category.Queue);
         break;
     case 8:
         MoveVerseToCategory (Category.Review);
         break;
     }
 }
开发者ID:pierceboggan,项目名称:Verses,代码行数:33,代码来源:MoveActionSheetDelegate.cs


示例11: CreateTilesPopUp

        public void CreateTilesPopUp()
        {
            UIActionSheet actionsheet = new UIActionSheet("Selecteer een categorie"){ "Map", "Road", "Shop", "Annuleer" };

            actionsheet.Clicked += (sender, e) =>
            {
                switch (e.ButtonIndex)
                {
                    case 0:
                        GlobalSupport.MessageIdentifier = 800;
                            NavigateToDetails();
                        break;
                    case 1:
                        GlobalSupport.MessageIdentifier = 801;
                            NavigateToDetails();
                        break;
                    case 2:
                        GlobalSupport.MessageIdentifier = 802;
                            NavigateToDetails();
                        break;
                }
            };

            actionsheet.ShowInView(this.View);
        }
开发者ID:ZuydUniversity,项目名称:ProgramADroid,代码行数:25,代码来源:VCHelpMenu.cs


示例12: ShowOptionsMenu

        public static void ShowOptionsMenu(this UIViewController vc, IParentMenu parentMenu)
        {
            if (parentMenu == null)
            {
                return;
            }

            var actionSheet = new UIActionSheet();

#warning TODO - make this OO - let the _parentMenu render itself...
            var actions = new List<ICommand>();
            foreach (var child in parentMenu.Children)
            {
                var childCast = child as CaptionAndIconMenu;

#warning More to do here - e.g. check for null!
                actionSheet.AddButton(childCast.Caption);
                actions.Add(childCast.Command);
            }

            actionSheet.Clicked += (object sender, UIButtonEventArgs e) =>
                {
                    if (e.ButtonIndex >= 0)
                    {
                        actions[e.ButtonIndex].Execute(null);
                    }
                };

#warning More to do here - e.g. check for null!
            //if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone)
            //	actionSheet.ShowFromToolbar(NavigationController.Toolbar);
            //else
            actionSheet.ShowFrom(vc.NavigationItem.RightBarButtonItem, true);
        }
开发者ID:darkice-matt-crombie,项目名称:MvxSpinnerTest,代码行数:34,代码来源:HackMvxMenuExtensionMethods.cs


示例13: LoadView

		public override void LoadView ()
		{

			NavigationItem.RightBarButtonItem= new UIBarButtonItem(UIBarButtonSystemItem.Compose,
				delegate {
					var actionSheet = new UIActionSheet ("Email", null, "Cancel", "PNG", "PDF"){
						Style = UIActionSheetStyle.Default
					};

					actionSheet.Clicked += delegate (object sender, UIButtonEventArgs args){

						if(args.ButtonIndex > 1)
							return;

						Email(args.ButtonIndex == 0 ? "png" : "pdf");
					};

					actionSheet.ShowInView (View);
				});


			View = new UIView(plotFrame);
			image_plotted_by_OxyPlot = new GraphView(plotModel);
			image_plotted_by_OxyPlot.Frame = plotFrame;
			View.AddSubview(image_plotted_by_OxyPlot);
			image_plotted_by_OxyPlot.SetAllowPinchScaling(true);

		}
开发者ID:jgodinez,项目名称:OxyPlot.2DGraphLib.MonoTouch,代码行数:28,代码来源:GraphViewController.cs


示例14: LoadView

        public override void LoadView ()
        {
            NavigationItem.RightBarButtonItem= new UIBarButtonItem(UIBarButtonSystemItem.Compose,
                delegate {
                    var actionSheet = new UIActionSheet ("Email", null, "Cancel", "PNG", "PDF"){
                        Style = UIActionSheetStyle.Default
                    };

                    actionSheet.Clicked += delegate (object sender, UIButtonEventArgs args){

                        if(args.ButtonIndex > 1)
                            return;

                        Email(args.ButtonIndex == 0 ? "png" : "pdf");
                    };

                    actionSheet.ShowInView (View);
                });

            // Only for iOS 7 and later?
            this.EdgesForExtendedLayout = UIRectEdge.None;

            this.View = this.plotView;

        }
开发者ID:Celderon,项目名称:oxyplot,代码行数:25,代码来源:GraphViewController.cs


示例15: ActionSheetDatePicker

        /// <summary>
        /// 
        /// </summary>
        public ActionSheetDatePicker(UIView owner)
        {
            // save our uiview owner
            this.owner = owner;

            // configure the title label
            titleLabel.BackgroundColor = UIColor.Clear;
            titleLabel.TextColor = UIColor.LightTextColor;
            titleLabel.Font = UIFont.BoldSystemFontOfSize (18);

            // configure the done button
            doneButton.SetTitle ("done", UIControlState.Normal);
            doneButton.TouchUpInside += (s, e) => {
                actionSheet.DismissWithClickedButtonIndex (0, true);
                // Add DoneButtonClicked Event
                //Console.WriteLine("Done clicked");
                if (DoneButtonClicked != null)
                {
                    DoneButtonClicked(s,e);
                }

            };

            // expose done clicked event

            // create + configure the action sheet
            actionSheet = new UIActionSheet () { Style = UIActionSheetStyle.BlackTranslucent };
            actionSheet.Clicked += (s, e) => { Console.WriteLine ("Clicked on item {0}", e.ButtonIndex); };

            // add our controls to the action sheet
            actionSheet.AddSubview (datePicker);
            actionSheet.AddSubview (titleLabel);
            actionSheet.AddSubview (doneButton);
        }
开发者ID:FabG,项目名称:XploreLite,代码行数:37,代码来源:ActionSheetDatePicker.cs


示例16: ShareLink

 public void ShareLink(string title, string status, string link)
 {
     var buttonTitle = string.Empty;
     var actionSheet = new UIActionSheet("Partilhar");
     actionSheet.AddButton("Facebook");
     actionSheet.AddButton("Twitter");
     actionSheet.Clicked += delegate(object a, UIKit.UIButtonEventArgs b)
     {
         if(b.ButtonIndex != -1)
         {
             buttonTitle = actionSheet.ButtonTitle(b.ButtonIndex);
         }
     };
     actionSheet.Dismissed += (sender, e) =>
     {
         if (buttonTitle.Equals("Facebook"))
         {
             ShareOnService(SLServiceKind.Facebook, title, status, link);
         }
         else if (buttonTitle.Equals("Twitter"))
         {
             ShareOnService(SLServiceKind.Twitter, title, status, link);
         }
     };
     actionSheet.ShowInView(UIApplication.SharedApplication.KeyWindow.RootViewController.View);
 }
开发者ID:amolkhot,项目名称:XamarinWorkshop,代码行数:26,代码来源:ShareService.cs


示例17: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad ();

            this.txt.ShouldReturn += (textField) => {
                textField.ResignFirstResponder();
                return true;
            };

            this.btn.TouchUpInside += (o,s) => {
                var actionSheet = new UIActionSheet ("Send Post?", null, "Cancel", null, "Send"){
                    Style = UIActionSheetStyle.Default
                };
                actionSheet.Clicked += ( sender,  args) => {
                    Console.WriteLine ("Clicked on item {0}  text: {1}", args.ButtonIndex, this.txt.Text);
                    if (args.ButtonIndex == 0)
                    {
                        MakePost(this.txt.Text);
                    }
                };

                actionSheet.ShowInView (View);
            };

            // Perform any additional setup after loading the view, typically from a nib.
        }
开发者ID:eiu165,项目名称:Parse,代码行数:26,代码来源:ParseViewController.cs


示例18: ViewDidLoad

        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            Title = "Main view";
            View.BackgroundColor = UIColor.White;

            NavigationItem.RightBarButtonItem = new UIBarButtonItem("Navigation", UIBarButtonItemStyle.Plain,
                (sender, args) =>
                {
                    var actionSheet = new UIActionSheet("Navigation");

                    actionSheet.AddButtonWithBinding("First view model modal", "Click ShowFirstWindowCommand");
                    actionSheet.AddButtonWithBinding("First view model page", "Click ShowFirstPageCommand");
                    actionSheet.AddButtonWithBinding("First view model tab", "Click ShowFirstTabCommand");

                    actionSheet.AddButtonWithBinding("Second view model modal", "Click ShowSecondWindowCommand");
                    actionSheet.AddButtonWithBinding("Second view model page", "Click ShowSecondPageCommand");
                    actionSheet.AddButtonWithBinding("Second view model tab", "Click ShowSecondTabCommand");

                    actionSheet.AddButtonWithBinding("Navigation (Clear back stack)", "Click ShowBackStackPageCommand");

                    actionSheet.CancelButtonIndex = actionSheet.AddButton("Cancel");
                    actionSheet.ShowEx(sender, (sheet, o) => sheet.ShowFrom((UIBarButtonItem)o, true));
                });


            using (var bindingSet = new BindingSet<MainViewModel>())
            {
                //TabBar
                bindingSet.Bind(this, AttachedMemberConstants.ItemsSource).To(() => model => model.ItemsSource);
                bindingSet.Bind(this, AttachedMemberConstants.SelectedItem).To(() => model => model.SelectedItem).TwoWay();
            }
        }
开发者ID:xRoulanDx,项目名称:MugenMvvmToolkit.Samples,代码行数:33,代码来源:MainViewController.cs


示例19: CommitEditingStyle

		public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
		{
			var dog = DogList.ElementAt(indexPath.Row);
			
			var actionSheet = new UIActionSheet("") {"Slett hund", Utils.Translate("cancel")};
			actionSheet.Title = dog.Navn + " vil bli slettet og fjernet fra alle logger.";
			actionSheet.DestructiveButtonIndex = 0;
			actionSheet.CancelButtonIndex = 1;
			actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
			
			actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
				Console.WriteLine(e.ButtonIndex);
				switch (e.ButtonIndex)
				{
				case 0:
					//Slett
					JaktLoggApp.instance.DeleteDog(dog);
					_controller.Refresh();
					break;
				case 1:
					//Avbryt
					break;
				}
			};
		}
开发者ID:darkwood,项目名称:Jaktloggen,代码行数:25,代码来源:DogsTableSource.cs


示例20: HandleBtPageCurlClicked

		void HandleBtPageCurlClicked (object sender, EventArgs e)
		{
			var actionSheet = new UIActionSheet("") {"Treff", "Bom", "Observasjoner", "Alle loggføringer"};
			actionSheet.Title = "Vis bare:";
			actionSheet.CancelButtonIndex = 3;
			actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
			
			actionSheet.Clicked += delegate(object s, UIButtonEventArgs evt) {

				switch (evt.ButtonIndex)
				{
				case 0:
					Filter = "Treff";
					break;
				case 1:
					Filter = "Bom";
				break;
				case 2:
					Filter = "Obs";
				break;
				case 3:
				default:
					Filter = "";
				break;
				}
				
				RefreshMap();
			};
		}
开发者ID:TheGiant,项目名称:Jaktloggen,代码行数:29,代码来源:StatsLoggMap.xib.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# UIActivityIndicatorView类代码示例发布时间:2022-05-24
下一篇:
C# UIActionEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap