Esempio n. 1
0
        private static List <MessageBoxExButton> MakeButtons(MessageBoxExType b)
        {
            if (ResourceTextConfig == null)
            {
                ResourceTextConfig = new ResourceTextConfig("DataTools.MessageBoxEx.Resources.AppResources", Assembly.GetCallingAssembly());
            }

            var rtc    = ResourceTextConfig;
            var btnOut = new List <MessageBoxExButton>();

            switch (b)
            {
            case MessageBoxExType.AbortRetryIgnore:

                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.Abort), MessageBoxExResult.Abort));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.Retry), MessageBoxExResult.Retry, true));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.Ignore), MessageBoxExResult.Ignore));

                break;

            case MessageBoxExType.OK:

                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.OK), MessageBoxExResult.OK, true));
                break;

            case MessageBoxExType.OKCancel:

                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.OK), MessageBoxExResult.OK, true));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.Cancel), MessageBoxExResult.Cancel, false));

                break;

            case MessageBoxExType.YesNo:

                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.Yes), MessageBoxExResult.Yes, true));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.No), MessageBoxExResult.No, false));

                break;

            case MessageBoxExType.YesNoCancel:

                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.Yes), MessageBoxExResult.Yes, true));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.No), MessageBoxExResult.No, false));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.Cancel), MessageBoxExResult.Cancel, false));

                break;

            case MessageBoxExType.YesNoAll:

                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.Yes), MessageBoxExResult.Yes, true));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.YesToAll), MessageBoxExResult.YesToAll, false));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.No), MessageBoxExResult.No, false));

                break;

            case MessageBoxExType.YesNoAllCancel:

                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.Yes), MessageBoxExResult.Yes, true));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.YesToAll), MessageBoxExResult.YesToAll, false));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.No), MessageBoxExResult.No, false));
                btnOut.Add(new MessageBoxExButton(rtc.GetText(MessageBoxExResult.Cancel), MessageBoxExResult.Cancel, false));

                break;
            }

            return(btnOut);
        }
Esempio n. 2
0
 static MessageBoxEx()
 {
     ResourceTextConfig = new ResourceTextConfig("DataTools.MessageBoxEx.Resources.AppResources", Assembly.GetCallingAssembly());
 }