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


C# UIActionSheet.ShowFromTabBar方法代码示例

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


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

示例1: 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

示例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: 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

示例4: RightBarButtonClicked

		private void RightBarButtonClicked(object sender, EventArgs args)
		{
			var actionSheet = new UIActionSheet("") {"Send på e-post", "Avbryt"};
			actionSheet.Title = "Lag rapporter fra jakta";
			//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;
				}
			};
			
			//var reportScreen = new ReportJakt(jakt);
			
			
			//reportScreen.ModalTransitionStyle = UIModalTransitionStyle.CoverVertical;
			
		}
开发者ID:TheGiant,项目名称:Jaktloggen,代码行数:39,代码来源:JaktItemScreen.xib.cs

示例5: HandleDeleteButtonTouchUpInside

		void HandleDeleteButtonTouchUpInside ()
		{
			var actionSheet = new UIActionSheet("") {"Slett", "Avbryt"};
			actionSheet.Title = "Jeger blir slettet permanent, 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
					_controller.Delete(_controller.jeger);
					break;
				case 1:
					//Avbryt
					
					break;
				}
			};
			
		}
开发者ID:TheGiant,项目名称:Jaktloggen,代码行数:24,代码来源:JegerItemTableSource.cs

示例6: HandleDeleteButtonTouchUpInside

		void HandleDeleteButtonTouchUpInside ()
		{
			var actionSheet = new UIActionSheet("") {Utils.Translate("delete"), Utils.Translate("cancel")};
			actionSheet.Title = Utils.Translate("specie.deletewarning");
			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
					_controller.Delete(_controller.art);
					break;
				case 1:
					//Avbryt
					
					break;
				}
			};
			
		}
开发者ID:darkwood,项目名称:Jaktloggen,代码行数:24,代码来源:ArtTableSource.cs

示例7: CommitEditingStyle

		public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
		{
			var jeger = JegerList.ElementAt(indexPath.Row);
			
			var actionSheet = new UIActionSheet("") {"Slett jeger", Utils.Translate("cancel")};
			actionSheet.Title = jeger.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.DeleteJeger(jeger);
					_controller.Refresh();
					break;
				case 1:
					//Avbryt
					break;
				}
			};
		}
开发者ID:darkwood,项目名称:Jaktloggen,代码行数:25,代码来源:JegerePickerSource.cs

示例8: HandleMoveButtonCellTapped

        void HandleMoveButtonCellTapped(UITableView tableView)
        {
            if (selectedVerses != null && selectedVerses.Count != 0)
            {
                var actionSheetDelegate = new MoveActionSheetDelegate(tableViewController, data, selectedVerses);
                var actionSheet = new UIActionSheet
                {
                    CancelButtonIndex = 9,
                    Delegate = actionSheetDelegate,
                    Title = "Move"
                };

                actionSheet.Add("Sunday");
                actionSheet.Add("Monday");
                actionSheet.Add("Tuesday");
                actionSheet.Add("Wednesday");
                actionSheet.Add("Thursday");
                actionSheet.Add("Friday");
                actionSheet.Add("Saturday");
                actionSheet.Add("Queue");
                actionSheet.Add("Review");
                actionSheet.Add("Cancel");

                actionSheet.ShowFromTabBar(AppDelegate.TabBarController.TabBar);
                selected = new bool[data.Count];
            }
            else
            {
                new UIAlertView("No Selected Verses", "Whoops! Select the verses you wish to move first!", null, "Okay", null).Show();
            }
        }
开发者ID:pierceboggan,项目名称:Verses,代码行数:31,代码来源:MemorizationQueueSource.cs

示例9: CommitEditingStyle

		public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
		{
			
			var actionSheet = new UIActionSheet("") {"Slett", "Avbryt"};
			actionSheet.Title = "Alle logger under denne jakten blir også slettet.";
			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
					var row = indexPath.Row;
					var section = indexPath.Section;
					var datelist = (from item in JaktList
										select item.DatoFra.Year).Distinct().ToList();
					var currentItems = JaktList.Where(l => l.DatoFra.Year == datelist.ElementAt(section));
					
					var jakt = currentItems.ElementAt(row);
					JaktLoggApp.instance.DeleteJakt(jakt);
					_controller.Refresh();
					break;
				case 1:
					//Avbryt
					
					break;
				}
			};
			
		}
开发者ID:TheGiant,项目名称:Jaktloggen,代码行数:33,代码来源:JaktTableSource.cs

示例10: PickImage

		public void PickImage(){

			loadView.StartAnimating();
			picker = new UIImagePickerController();
			picker.Delegate = new pickerDelegate(this);
			picker.AllowsEditing = true;
			var actionSheet = new UIActionSheet("") 
									{
										Utils.Translate("choosefromlibrary"), 
										Utils.Translate("takepicture"), 
										Utils.Translate("cancel")
									};
			actionSheet.Style = UIActionSheetStyle.Default;
			
			actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
			
			actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
				switch (e.ButtonIndex)
				{
				case 0:
					//choose photo
					picker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
					this.PresentModalViewController(picker, true);
					break;
				case 1:
					//take photo
					picker.SourceType = UIImagePickerControllerSourceType.Camera;
					this.PresentModalViewController(picker, true);
					break;
				case 2:
					//cancel
					NavigationController.PopViewControllerAnimated(true);
					break;
				}
			};
			
		}
开发者ID:darkwood,项目名称:Jaktloggen,代码行数:37,代码来源:FieldImagePickerScreen.xib.cs

示例11: RowSelected

 public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
 {
     if (indexPath.Row == 0)
     {
         _sheet = new UIActionSheet("Change Torrent Status", null, "Cancel", "Remove Torrent + Data", "Remove");
         _sheet.Dismissed += OnDimissed;
         _sheet.ShowFromTabBar(_tabBar);
     }
 }
开发者ID:jonathanpeppers,项目名称:uController,代码行数:9,代码来源:TorrentDetailsDelegate.cs

示例12: CommitEditingStyle

		public override void CommitEditingStyle (UITableView tableView, UITableViewCellEditingStyle editingStyle, NSIndexPath indexPath)
		{
			
			var actionSheet = new UIActionSheet("") {"Slett", "Avbryt"};
			actionSheet.Title = "Loggføringen blir slettet permanent.";
			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
					var loggItem = _logger.ElementAt(indexPath.Row);
					JaktLoggApp.instance.DeleteLogg(loggItem);
					_controller.Refresh();
					break;
				case 1:
					//Avbryt
					
					break;
				}
			};
			
		}
开发者ID:TheGiant,项目名称:Jaktloggen,代码行数:27,代码来源:LoggerTableSource.cs

示例13: HandleEditButtonTapped

        private void HandleEditButtonTapped(object sender, EventArgs args)
        {
            var actionSheetDelegate = new VerseEditActionSheetDelegate (this, verse);

            var actionSheet = new UIActionSheet {
                CancelButtonIndex = 2,
                DestructiveButtonIndex = 0,
                Delegate = actionSheetDelegate,
            };

            actionSheet.Add ("Delete");
            actionSheet.Add ("Edit");
            actionSheet.Add ("Cancel");

            actionSheet.ShowFromTabBar (AppDelegate.TabBarController.TabBar);
        }
开发者ID:pierceboggan,项目名称:Verses,代码行数:16,代码来源:VerseDetailDialog.cs

示例14: PickImage

		public void PickImage(){
			
			picker = new UIImagePickerController();
			picker.Delegate = new pickerDelegate(this);
			picker.AllowsEditing = true;
			var actionSheet = new UIActionSheet("") {"Velg fra bibliotek", "Ta bilde", "Avbryt"};
			actionSheet.Style = UIActionSheetStyle.Default;
			
			actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
			
			actionSheet.Clicked += delegate(object sender, UIButtonEventArgs e) {
				switch (e.ButtonIndex)
				{
				case 0:
					//choose photo
					picker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
					this.PresentModalViewController(picker, true);
					break;
				case 1:
					//take photo
					picker.SourceType = UIImagePickerControllerSourceType.Camera;
					this.PresentModalViewController(picker, true);
					break;
				case 2:
					//cancel
					NavigationController.PopViewControllerAnimated(true);
					break;
				}
			};
			
		}
开发者ID:TheGiant,项目名称:Jaktloggen,代码行数:31,代码来源:FieldImagePickerScreen.xib.cs

示例15: ViewDidLoad

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

            // Create an image picker controller.
            var imagePicker = new UIImagePickerController();

            // Handle an image selected.
            imagePicker.FinishedPickingImage += (sender, e) => {
                this.InvokeOnMainThread(() => {
                    this.imgSnapshot.Image = e.Image;
                });
                DismissViewController(true,  null);
                //DismissModalViewControllerAnimated(true);
            };

            // Handle media selected.
            imagePicker.FinishedPickingMedia += (sender, e) => {
                // After many crashes and debugging the image was found to be
                // part of a key/value collection with the key name of
                // "UIImagePickerControllerOriginalImage" (typically index 0).
                // Go figure.
                UIImage image = (UIImage)e.Info.ObjectForKey(
                    new NSString("UIImagePickerControllerOriginalImage"));

                if (image != null)
                {
                    this.InvokeOnMainThread(() => {
                        this.imgSnapshot.Image = image;
                    });
                }
                DismissViewController(true,  null);
                //DismissModalViewControllerAnimated(true);
            };

            // Handle cancellation of picker.
            imagePicker.Canceled += (sender, e) => {
                DismissModalViewControllerAnimated(true);
            };

            // Handle customer asking for a photo.
            this.btnTakePicture.TouchUpInside += (sender, e) => {
                // Create an action sheet.
                var actionSheet = new UIActionSheet("Image Source") { "Photo Library", "Camera", "Cancel" };
                actionSheet.Style = UIActionSheetStyle.BlackTranslucent;
                //actionSheet.ShowInView(this.View );
                actionSheet.ShowFromTabBar(this.TabBarController.TabBar);
                // Action sheet navigation handling.
                actionSheet.Clicked += (actionSender, actionEvent) => {
                    Console.WriteLine("dismiss  buttonIndex: " + actionEvent.ButtonIndex);
                    switch (actionEvent.ButtonIndex)
                    {
                    case 0:
                        // Photo library.
                        imagePicker.SourceType = UIImagePickerControllerSourceType.PhotoLibrary;
                        imagePicker.AllowsEditing = false;
                        this.PresentViewController(imagePicker, true, null);
                        break;

                    case 1:
                        // Camera.
                        bool isAvailable = UIImagePickerController.IsCameraDeviceAvailable (UIImagePickerControllerCameraDevice.Rear)
                            || UIImagePickerController.IsCameraDeviceAvailable (UIImagePickerControllerCameraDevice.Front)   ;
                        if (isAvailable)
                        {
                            imagePicker.SourceType = UIImagePickerControllerSourceType.Camera;
                            imagePicker.AllowsEditing = false;
                            this.PresentViewController(imagePicker, true, null);
                        }
                        else
                        {
                            using(var alert = new UIAlertView("Sorry", "this device has No Camera", null, "OK", null))
                            {
                                    alert.Show();
                            }
                        }
                        break;
                    default:
                        break;
                    }
                };
            };
        }
开发者ID:eiu165,项目名称:checklist,代码行数:83,代码来源:CameraScreen.cs


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