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


C# AlertDialog.Builder.SetButton2方法代码示例

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


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

示例1: OnBackPressed

 public override void OnBackPressed()
 {
     AlertDialog ad = new AlertDialog.Builder(this).Create();
     ad.SetCancelable(false); // This blocks the 'BACK' button
     ad.SetMessage("Czy chcesz wyjϾ z gry?");
     ad.SetButton("Nie", delegate { /*dialogLive = false;*/ });
     ad.SetButton2("Tak", delegate
     {
         Sockets.client.Close();
         Android.OS.Process.KillProcess(Android.OS.Process.MyPid());
         //dialogLive = false;
     });
     //dialogLive = true;
     ad.Show();
 }
开发者ID:maciekjanczyk,项目名称:kik-xamarin,代码行数:15,代码来源:GameManager.cs

示例2: SaveCode

        public void SaveCode()
        {
            int getLastID = codeDatabase.SelectAll<Code>().Count + 1;

            LinearLayout layout = new LinearLayout(this);
            layout.Orientation = Orientation.Vertical;

            EditText inputFileName = new EditText(this);
            inputFileName.Hint = "FileName";
            layout.AddView (inputFileName);

            EditText inputAuthor = new EditText(this);
            inputAuthor.Hint = "Author";
            layout.AddView (inputAuthor);

            inputAuthor.Text = GlobalSupport.LastNameInput;
            AlertDialog ad = new AlertDialog.Builder (this).Create();
            ad.SetTitle ("Enter name");
            ad.SetMessage ("Please enter a file name and your name.");
            ad.SetView (layout);
            ad.SetButton ("Save",(senderAlert, args) => {
                //Save File
                GlobalSupport.LastNameInput = inputAuthor.Text;
                Code code = new Code();
                code.CodeString = txtCodeField.Text;
                code.Author = inputAuthor.Text;
                code.FileName = inputFileName.Text;
                code.Date = DateTime.Now;
                code.LevelName = GlobalSupport.GameLevel.Substring(0,GlobalSupport.GameLevel.LastIndexOf('.'));
                code.Language = GlobalSupport.GameLanguage;

                codeDatabase.Insert(code);
            });

            ad.SetButton2 ("Cancel", (senderAlert, args) => {
                // cancels (Do nothing)
            });

            ad.Show ();
        }
开发者ID:ZuydUniversity,项目名称:ProgramADroid,代码行数:40,代码来源:ActivityGame.cs

示例3: ShowScorePopup

        private void ShowScorePopup(int score)
        {
            EditText input = new EditText(this);
            input.Text = GlobalSupport.LastNameInput;
            AlertDialog ad = new AlertDialog.Builder (this).Create();
            ad.SetTitle ("Enter name");
            ad.SetMessage ("You have passed the level with a score of " + score + "! Please enter your name.");
            ad.SetView (input);
            ad.SetButton ("Save",(senderAlert, args) => {
                //Save Highscore
                robot.SaveHighscore(score,input.Text);
                GlobalSupport.LastNameInput = input.Text;

            });

            ad.SetButton2 ("Cancel", (senderAlert, args) => {
                // cancels (Do nothing)
            });

            ad.Show ();
        }
开发者ID:ZuydUniversity,项目名称:ProgramADroid,代码行数:21,代码来源:ActivityGame.cs

示例4: OnBackPressed

 public override void OnBackPressed()
 {
     AlertDialog ad = new AlertDialog.Builder(this).Create();
     ad.SetCancelable(false); // This blocks the 'BACK' button
     ad.SetMessage("Czy chcesz opuœciæ grê (oddasz walkowerem)?");
     ad.SetButton("Nie", delegate { dialogLive = false; });
     ad.SetButton2("Tak", delegate
     {
         byte[] buffer = System.Text.Encoding.ASCII.GetBytes(string.Format("{0};{1}", Convert.ToInt32(MessageTypes.Left), nickname));
         Sockets.client.GetStream().Write(buffer, 0, buffer.Length);
         dialogLive = false;
     });
     dialogLive = true;
     ad.Show();
 }
开发者ID:maciekjanczyk,项目名称:kik-xamarin,代码行数:15,代码来源:GameActivity.cs


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