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;
				}
			};
			
		}
		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;
					}
				};
			}
		}
Example #3
0
		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();
			};
		}
        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();
            }
        }
Example #5
0
        void SetupAndShowActionSheet(DialogViewController dvc)
        {
            var section = dvc.Root [0];

            ActionSheetDelegate = new MoveActionSheetDelegate(dvc, section);

            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);
        }
 public override void ShowFromTabBar(UITabBar view)
 {
     Prepare();
     if (_ActualActionSheet != null)
     {
         _ActualActionSheet.ShowFromTabBar(view);
     }
 }
Example #7
0
 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);
     }
 }
Example #8
0
        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);
        }
        /// <summary>
        /// Shows the action sheet picker from the view that was set as the owner.
        /// </summary>
        public void Show()
        {
            // declare vars
            float      titleBarHeight   = 40;
            SizeF      actionSheetSize  = new SizeF(_owner.Frame.Width, picker.Frame.Height + titleBarHeight);
            RectangleF actionSheetFrame = new RectangleF(0, (UIScreen.MainScreen.ApplicationFrame.Height - actionSheetSize.Height), actionSheetSize.Width, actionSheetSize.Height);

            // show the action sheet and add the controls to it
            if (_tabbar != null)
            {
                _actionSheet.ShowFromTabBar(_tabbar);
            }
            else
            {
                _actionSheet.ShowInView(_owner);
            }

            // resize the action sheet to fit our other stuff
            _actionSheet.Frame = actionSheetFrame;

            // move our picker to be at the bottom of the actionsheet (view coords are relative to the action sheet)
            picker.Frame = new RectangleF(picker.Frame.X, titleBarHeight, picker.Frame.Width, picker.Frame.Height);

            // move our label to the top of the action sheet
            _titleLabel.Frame = new RectangleF(10, 4, _owner.Frame.Width - 100, 35);

            // ipad
            if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
            {
                var popover = _actionSheet.Superview.Superview;
                if (popover != null)
                {
                    var x      = _actionSheet.Frame.X + MARGIN;
                    var y      = (UIScreen.MainScreen.ApplicationFrame.Height - _actionSheet.Frame.Height) / 2;
                    var width  = _actionSheet.Frame.Width - (MARGIN * 2);
                    var height = _actionSheet.Frame.Height;

                    popover.Frame      = new RectangleF(x, y, width, height);
                    _actionSheet.Frame = new RectangleF(x, y, width - (CHROMEWIDTHLEFT + CHROMEWIDTHRIGHT), height - (CHROMEWIDTHLEFT + CHROMEWIDTHRIGHT));

                    picker.Frame = new RectangleF(picker.Frame.X, picker.Frame.Y, _actionSheet.Frame.Width, picker.Frame.Height);

                    _toolbar.SizeToFit();
                }
            }
        }
Example #10
0
		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;
			
		}
		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;
				}
			};
			
		}
Example #12
0
			private void GotoAttention(object sender, EventArgs e)
			{
				if (AppDelegateIPhone.tabBarController == null)
					return;
				
				bool isPhotoOwner = _Tweet.Image.UserId == AppDelegateIPhone.AIphone.GetMainUserId();
				
				var actionSheet = new UIActionSheet("Post options")
				{
					Style = UIActionSheetStyle.Default,
				};
				
				if (isPhotoOwner)
				{
					actionSheet.DestructiveButtonIndex = actionSheet.AddButton("Delete");
					actionSheet.AddButton("Share");
					actionSheet.CancelButtonIndex = actionSheet.AddButton("Cancel");
					actionSheet.Clicked += delegate (object s, UIButtonEventArgs args)
					{
						switch (args.ButtonIndex)
						{
							case 0: // Delete
							{
								if (_Tweet.DeleteAction != null)
									_Tweet.DeleteAction(_Tweet);
								break;
							}
							case 1: // Share
							{		
								var _MSP = AppDelegateIPhone.tabBarController.SelectedViewController as UINavigationController;
								var vc = new SocialNetworksShareViewController(_MSP,_Tweet.Image);
								_MSP.PushViewController(vc, true);							
								break;
							}
							case 2: // Cancel
							{
								break;
							}
						}
					};
				}
				else
				{
					actionSheet.DestructiveButtonIndex = actionSheet.AddButton("Report content");
					actionSheet.AddButton("Share");
					actionSheet.CancelButtonIndex = actionSheet.AddButton("Cancel");
					actionSheet.Clicked += delegate (object s, UIButtonEventArgs args)
					{
						switch (args.ButtonIndex)
						{
							case 0: // Report content
							{
								var reporter = new ContentReporter("", "Why ?", "Cancel", "Report content");
								reporter.SelectedImage = _Tweet.Image;
								reporter.Show();
								break;
							}
							case 1: // Share
							{		
								var _MSP = AppDelegateIPhone.tabBarController.SelectedViewController as UINavigationController;
								var vc = new SocialNetworksShareViewController(_MSP,_Tweet.Image);
								_MSP.PushViewController(vc, true);							
								break;
							}
							case 2: // Cancel
							{
								break;
							}
						}
					};
				}				
				actionSheet.ShowFromTabBar (AppDelegateIPhone.tabBarController.TabBar);
			}			
Example #13
0
        // handle events associated with the Speech Popup
        private void SpeechButton_Click(object sender, EventArgs e)
        {
            // require a connection
//            if (DeviceNetworkInformation.IsNetworkAvailable == false ||
//                NetworkInterface.GetIsNetworkAvailable() == false)
//            {
//                MessageBox.Show("apologies - a network connection is required for this feature, and you appear to be disconnected :-(");
//                return;
//            }

            // require an account
            if (App.ViewModel.User == null)
            {
                MessageBoxResult result = MessageBox.Show(
                    "the speech feature requires an account.  create a free account now?",
                    "create account?",
                    MessageBoxButton.OKCancel);
                if (result == MessageBoxResult.Cancel)
                {
                    return;
                }

                // trace page navigation
                TraceHelper.StartMessage("Add: Navigate to Settings");

                // Navigate to the settings page
                this.TabBarController.PresentViewController(this.TabBarController.ViewControllers[3], true, null);
                return;
            }

            // initialize the speech popup delegate
            SpeechPopupDelegate.parent      = this;
            SpeechPopupDelegate.speechState = NuanceHelper.SpeechState.Initializing;

            // store debug / timing info
            SpeechPopupDelegate.speechStart       = DateTime.Now;
            SpeechPopupDelegate.speechDebugString = "";

            // store debug / timing info
            TimeSpan ts          = DateTime.Now - SpeechPopupDelegate.speechStart;
            string   stateString = NuanceHelper.SpeechStateString(SpeechPopupDelegate.speechState);
            string   traceString = String.Format("New state: {0}; Time: {1}; Message: {2}", stateString, ts.TotalSeconds, "Connecting Socket");

            TraceHelper.AddMessage(traceString);
            SpeechPopupDelegate.speechDebugString += traceString + "\n";

            // cancel any existing speech operation
            NuanceHelper.Cleanup();

            // initialize the connection to the speech service
            NuanceHelper.Start(
                App.ViewModel.User,
                new NuanceHelper.SpeechToTextCallbackDelegate(SpeechPopupDelegate.SpeechPopup_SpeechToTextCallback),
                new NuanceHelper.SpeechStateCallbackDelegate(SpeechPopupDelegate.SpeechPopup_SpeechStateCallback),
                new MainViewModel.NetworkOperationInProgressCallbackDelegate(SpeechPopupDelegate.SpeechPopup_NetworkOperationInProgressCallBack));

            if (SpeechPopupDelegate.speechState == NuanceHelper.SpeechState.Initializing)
            {
                // open the popup
                SetupSpeechPopup("initializing...");
                SpeechPopup.ShowFromTabBar(((UITabBarController)this.ParentViewController).TabBar);
            }
            else
            {
                MessageBox.Show("our apologies - speech is unavailable at this time.");
            }
        }
Example #14
0
		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;
				}
			};
			
		}
Example #15
0
		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;
				}
			};
		}
Example #16
0
		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;
				}
			};
			
		}
 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);
     }
 }
Example #18
0
			private void HandleAddToEventTouchDown (object sender, EventArgs e)
			{
				if (AppDelegateIPhone.tabBarController == null)
					return;
				
				var actionSheet = new UIActionSheet("New post options")
				{
					Style = UIActionSheetStyle.Default,
				};				
				//actionSheet.DestructiveButtonIndex = actionSheet.AddButton("Delete");
				actionSheet.AddButton("Share descriptions");
				if (_Tweet.Image.IdAlbum != 0)
					actionSheet.AddButton("Add to album");
				
				actionSheet.CancelButtonIndex = actionSheet.AddButton("Cancel");
				actionSheet.Clicked += delegate (object s, UIButtonEventArgs args)
				{
					switch (args.ButtonIndex)
					{
						case 0: // Share descriptions
						{
							_Tweet.Options = PostOptions.ShareDescriptions;
							break;
						}
						case 1: // Add to album or Cancel
						{
							if (_Tweet.Image.IdAlbum == 0)
								return;
						
							_Tweet.Options = PostOptions.AddToAlbum;
							break;
						}
						case 2: // Cancel
						{
							return;
						}
					}
					
					if (_Tweet != null && _Tweet.Image != null)
						AppDelegateIPhone.AIphone.GotoToShare(_Tweet, AppDelegateIPhone.buzzNavigationController);
				};
				
				actionSheet.ShowFromTabBar (AppDelegateIPhone.tabBarController.TabBar);
			}					
Example #19
0
        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;
                    }
                };
            };
        }
		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;
				}
			};
			
		}
Example #21
0
		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;
				}
			};
			
		}
		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;
				}
			};
			
		}
		private void ClearClicked(object sender, EventArgs args)
		{
			var actionSheet = new UIActionSheet("") {Utils.Translate("removeposition"), Utils.Translate("cancel")};
			actionSheet.Title = Utils.Translate("confirm_removeposition");
			actionSheet.DestructiveButtonIndex = 0;
			actionSheet.CancelButtonIndex = 1;
			actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
			
			actionSheet.Clicked += delegate(object s, UIButtonEventArgs e) {
				Console.WriteLine(e.ButtonIndex);
				switch (e.ButtonIndex)
				{
				case 0:
					//Slett
					Latitude = Longitude = string.Empty;	
					locationManagerDelegate.ClearLocation();
					SetInfo(Utils.Translate("position_removed"));
					break;
				case 1:
					//Avbryt
					break;
				}
			};
			
		}
        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();
            }
        }
		private void ClearClicked(object sender, EventArgs args)
		{
			var actionSheet = new UIActionSheet("") {"Fjern posisjon", "Avbryt"};
			actionSheet.Title = "Bekreft fjerning av posisjon";
			actionSheet.DestructiveButtonIndex = 0;
			actionSheet.CancelButtonIndex = 1;
			actionSheet.ShowFromTabBar(JaktLoggApp.instance.TabBarController.TabBar);
			
			actionSheet.Clicked += delegate(object s, UIButtonEventArgs e) {
				Console.WriteLine(e.ButtonIndex);
				switch (e.ButtonIndex)
				{
				case 0:
					//Slett
					Latitude = Longitude = string.Empty;	
					locationManagerDelegate.ClearLocation();
					SetInfo("Posisjon fjernet");
					break;
				case 1:
					//Avbryt
					break;
				}
			};
			
		}
Example #26
0
        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);
        }
		private void ShowLocalisationFailedMessage()
		{
			var actionSheet = new UIActionSheet("Localisation failed. Go to Settings/Location Services/21 Off")
			{
				Style = UIActionSheetStyle.Default,
			};

			actionSheet.DestructiveButtonIndex = actionSheet.AddButton("Cancel");
			actionSheet.AddButton("Ok");
			actionSheet.CancelButtonIndex = actionSheet.DestructiveButtonIndex;
			actionSheet.Clicked += delegate (object s, UIButtonEventArgs args)
			{
				switch (args.ButtonIndex)
				{
					case 0: // Delete
					{			
						AppDelegateIPhone.AIphone.GotoToBuzz();
						break;
					}
					case 1: // Share
					{
						AppDelegateIPhone.AIphone.GotoToBuzz();
						break;
					}
					case 2: // Cancel
					{
						break;
					}
				}
			};
			
			actionSheet.ShowFromTabBar (AppDelegateIPhone.tabBarController.TabBar);
		}
Example #28
0
        partial void actionAddMarker(NSObject sender)
        {
            // Show a list of templates for the marker name
            UIActionSheet actionSheet = new UIActionSheet("Select a marker name template:", null, "Cancel", null, new string[4] { "Verse", "Chorus", "Bridge", "Solo" });
            actionSheet.Style = UIActionSheetStyle.BlackTranslucent;
            actionSheet.Clicked += (eventSender, e) => {

                // Check for cancel
                if(e.ButtonIndex == 4)
                    return;

                OnAddMarkerWithTemplate((MarkerTemplateNameType)e.ButtonIndex);
            };

            // Must use the tab bar controller to spawn the action sheet correctly. Remember, we're in a UIScrollView...
            AppDelegate appDelegate = (AppDelegate)UIApplication.SharedApplication.Delegate;
			actionSheet.ShowFromTabBar(appDelegate.MainViewController.TabBarController.TabBar);
        }