public static void Show(MessageCallback callback, string message, string caption, Buttons buttons, Icon icon, MessageBox.DefaultButton defaultButton) { //if(string.IsNullOrEmpty(caption)) //caption = AvLocalizationManager.GetString(6); MessageItem item = new MessageItem { caption = caption, buttons = buttons, defaultButton = defaultButton, callback = callback }; item.message = message; switch (icon) { case Icon.Hand: case Icon.Stop: case Icon.Error: //item.message.image = messageHandler.error; break; case Icon.Exclamation: case Icon.Warning: //item.message.image = messageHandler.warning; break; case Icon.Asterisk: case Icon.Information: //item.message.image = messageHandler.info; break; } if (items.Count > 2) { items.RemoveAt(0); } items.Add(item); AvUIManager.instance.ShowDialog(DialogName.MessageBox, item); }
private void SetupDisplayButtons(MessageItem item) { ResetMessageState(); switch (item.buttons) { case Buttons.OK: btnDialog[0].SetInfomation(DialogResult.Ok, 9017, location1Btn); break; case Buttons.OKCancel: btnDialog[0].SetInfomation(DialogResult.Ok, 9017, new Vector3(location2Btn.x+260,location2Btn.y,location2Btn.z)); btnDialog[1].SetInfomation(DialogResult.Cancel, 31,location2Btn); break; case Buttons.AbortRetryIgnore: btnDialog[0].SetInfomation(DialogResult.Abort, 34, location3Btn); btnDialog[1].SetInfomation(DialogResult.Retry, 35, new Vector3(location3Btn.x + 200, location2Btn.y, location2Btn.z)); btnDialog[2].SetInfomation(DialogResult.Ignore, 36, new Vector3(location3Btn.x + 200*2, location2Btn.y, location2Btn.z)); break; case Buttons.YesNoCancel: btnDialog[0].SetInfomation(DialogResult.Yes, 32, location3Btn); btnDialog[1].SetInfomation(DialogResult.No, 33, new Vector3(location3Btn.x + 200, location2Btn.y, location2Btn.z)); btnDialog[2].SetInfomation(DialogResult.Cancel, 31, new Vector3(location3Btn.x + 200 * 2, location2Btn.y, location2Btn.z)); break; case Buttons.YesNo: btnDialog[0].SetInfomation(DialogResult.Yes, 32, new Vector3(location2Btn.x + 260, location2Btn.y, location2Btn.z)); btnDialog[1].SetInfomation(DialogResult.No, 33, location2Btn); break; case Buttons.RetryCancel: btnDialog[0].SetInfomation(DialogResult.Retry, 35, location2Btn); btnDialog[1].SetInfomation(DialogResult.Cancel, 31, new Vector3(location2Btn.x + 260, location2Btn.y, location2Btn.z)); break; default: btnDialog[0].SetInfomation(DialogResult.None, 37, location1Btn); break; } }