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


C# UIActionSheet.ButtonTitle方法代码示例

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


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

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

示例2: ShowActionSheet

		private void ShowActionSheet(string status, string title = "", string link = "")
		{
			var actionSheet = new UIActionSheet("Share on");
			foreach (SLServiceKind service in Enum.GetValues(typeof(SLServiceKind)))
			{
				actionSheet.AddButton(service.ToString());
			}
			actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) {
				SLServiceKind serviceKind = (SLServiceKind)Enum.Parse(typeof(SLServiceKind), actionSheet.ButtonTitle(b.ButtonIndex));
				ShareOnService(serviceKind,title,status,link);
			};
			actionSheet.ShowInView (UIApplication.SharedApplication.KeyWindow.RootViewController.View);
		}
开发者ID:fagnerabsynth,项目名称:SharePlugin,代码行数:13,代码来源:ShareImplementation.cs

示例3: DeleteCode

        public void DeleteCode()
        {
            UIActionSheet actionSheet = new UIActionSheet("Selecteer Code");

            foreach (var item in codeDatabase.SelectAll<Code> ().Where (GlobalSupport.OpenCodeQuery).ToList())
            {
                actionSheet.Add(String.Format("{0} {1} {2}",item.ID,item.FileName,item.Author));
            }

            actionSheet.Add("Annuleer");

            actionSheet.Clicked += (sender, e) =>
            {
                if (e.ButtonIndex != actionSheet.ButtonCount - 1)
                {
                    codeDatabase.DeleteById<Code>(Convert.ToInt32(actionSheet.ButtonTitle(e.ButtonIndex).Split(' ')[0]));
                }
            };
            actionSheet.CancelButtonIndex = actionSheet.ButtonCount;
            actionSheet.ShowInView(this.View);
        }
开发者ID:ZuydUniversity,项目名称:ProgramADroid,代码行数:21,代码来源:VCGame.cs

示例4: ShowPendingContactOptions

		private void ShowPendingContactOptions()
		{
			try {
				UIActionSheet actionSheet;
				actionSheet = new UIActionSheet();
				if (!string.IsNullOrEmpty(this.mobile))
					actionSheet.AddButton(this.mobile);
				if (!string.IsNullOrEmpty(this.email))
					actionSheet.AddButton(this.email);
				actionSheet.AddButton("Cancel");
				actionSheet.Clicked += delegate(object a, UIButtonEventArgs b) {
					using (var conn = new SQLite.SQLiteConnection(AppDelegate._dbPath)) {
						string recipient = "";
						//int present_thread_id = 0;

						if (actionSheet.ButtonTitle(b.ButtonIndex) == this.mobile) {
							try {
								var phoneUtil = PhoneNumberUtil.GetInstance();
								recipient = phoneUtil.Format(phoneUtil.Parse(this.mobile, AppDelegate.GetCountryCode()), PhoneNumberFormat.E164);
							} catch (Exception e) {
								recipient = this.mobile;
							}
						} else if (actionSheet.ButtonTitle(b.ButtonIndex) == this.email) {
							recipient = this.email;
						}

						if (actionSheet.ButtonTitle(b.ButtonIndex) != "Cancel") { 
							/*
							List<PushChatThread> pctList = conn.Query<PushChatThread>("select * from PushChatThread");

							foreach (PushChatThread pct in pctList) {
								if (pct.Number.Equals(recipient)) {
									present_thread_id = pct.ID;
									break;
								}
							}
							*/
							PushChatThread thread = conn.FindWithQuery<PushChatThread>("select * from PushChatThread where Number = ?", recipient);
							//if (present_thread_id == 0) {
							if (thread == null) {
								PushContact contact = conn.FindWithQuery<PushContact>("select * from PushContact where Number = ?", recipient);
								thread = new PushChatThread {
									DisplayName = contact.Name,
									Number = recipient,
									Recipient_id = 0,
									TimeStamp = AppDelegate.CurrentTimeMillis(),
									Message_count = 0,
									Snippet = "",
									Read = 0,
									Type = "PushLocal"
								};
								conn.Insert(thread);
								conn.Commit();
								conn.Close();
								//present_thread_id = pct_val.ID;
							}

							//appDelegate.chatView.setThreadID(present_thread_id);
							appDelegate.chatView.setThreadID(thread.ID);
							appDelegate.chatView.setNumber(recipient);
							appDelegate.chatView.setThreadSelected(thread.DisplayName + " (" + recipient + ")");
							appDelegate.GoToView(appDelegate.chatView);
						}
					}
				};
				actionSheet.ShowInView(View);
			} catch (Exception ex) {
				Console.Write(ex.Message);
			}
		}
开发者ID:Securecom,项目名称:Securecom-Messaging-iOS,代码行数:70,代码来源:ContactListView.cs

示例5: ProcessBarcode

        private void ProcessBarcode(string text)
        {
            try
            {
                Shared.Database db = new Shared.Database();
                db.Initialize();

                int campusID = db.getCampusID();
                List<Area> classes = dl.getSecureAreas(campusID).ToList();
                List<Event> events = dl.getUpcomingEvents(campusID).ToList();

                int row = classPicker.SelectedRowInComponent (0);
                int rowEvent = eventPicker.SelectedRowInComponent(0);
                int InOUT = checkInOut.SelectedSegment;

                if (text.Length == 6) {
                    Person parent = dl.getPerson(Convert.ToInt32(text.Substring(1)));
                    List<Person> children = dl.getChildren(parent.ID).ToList();
                    string message = "";
                    UIActionSheet action = new UIActionSheet("Which child would you like to check in/out");
                    foreach (Person child in children)
                    {
                        action.AddButton(child.ID.ToString() + ":" + child.FirstName);
                    }
                    action.AddButton("Cancel");
                    action.CancelButtonIndex = action.ButtonCount - 1;
                    action.Clicked += (object sender, UIButtonEventArgs e) => {
                        string val = action.ButtonTitle(e.ButtonIndex);
                        if (val.IndexOf(":") > 0)
                        {
                            int personid = Convert.ToInt32(val.Substring(0, val.IndexOf(":")));
                            Person child = dl.getPerson (personid);
                            dl.checkinToSecureArea(personid, classes [row].ID, events[rowEvent].ID, InOUT);
                            bool boVal = (InOUT == 0 ? true : false);
                            UIAlertView alert = new UIAlertView ("Checkin", child.LastName + ", " + child.FirstName + " has been checked " + (boVal ? "INTO " + classes [row].Description : "OUT"), null, "OK", null);
                            alert.Clicked += (object senderAlert, UIButtonEventArgs eAlert) => {
                                picker.StartScanning();
                            };
                            alert.Canceled += (object senderCancelled, EventArgs eCancelled) => {
                                picker.StartScanning();
                            };
                            alert.Show ();
                        }
                        else
                        {
                            picker.StartScanning();
                        }
                    };
                    action.Canceled += (object sender, EventArgs e) => {
                        picker.StartScanning();
                    };
                    action.ShowInView(View);
                } else {
                    Person child = dl.getPerson (Convert.ToInt32 (text));
                    dl.checkinToSecureArea(child.ID, classes [row].ID, events[rowEvent].ID, InOUT);
                    dl.loadingOverlay = new LoadingOverlay(View.Bounds);
                    View.AddSubview(dl.loadingOverlay);
                    dl.Sync();
                    bool val = (InOUT == 0 ? true : false);
                    UIAlertView alert = new UIAlertView ("Checkin", child.LastName + ", " + child.FirstName + " has been checked " + (val ? "INTO " + classes [row].Description : "OUT"), null, "OK", null);
                    alert.Clicked += (object sender, UIButtonEventArgs e) => {
                        picker.StartScanning();
                    };
                    alert.Canceled += (object sender, EventArgs e) => {
                        picker.StartScanning();
                    };
                    alert.Show ();
                }
            }
            catch {
                UIAlertView alert = new UIAlertView ("Error", "Unrecognizable barcode", null, "OK", null);
                alert.Show ();
                picker.StartScanning ();
            }
        }
开发者ID:Wazzo79,项目名称:Illumin8---Kids-Checkin-App,代码行数:75,代码来源:CheckinViewController.cs


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