本文整理汇总了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();
}
示例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 ();
}
示例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 ();
}
示例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();
}