コード例 #1
0
        public static bool?Show(string message, string detail, MessageBoxWindowType windowType, MessageBoxWindowButtonsType buttonType)
        {
            MessageBoxWindow window = new MessageBoxWindow();

            window.Message     = message;
            window.Detail      = detail;
            window.WindowType  = windowType;
            window.ButtonsType = buttonType;

            switch (windowType)
            {
            case MessageBoxWindowType.Information:
                window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Information");
                break;

            case MessageBoxWindowType.Question:
                window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Question");
                break;

            case MessageBoxWindowType.Warning:
                window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Warning");
                break;

            case MessageBoxWindowType.Error:
                window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Error");
                break;

            default:
                window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Information");
                break;
            }

            return(window.ShowDialog());
        }
コード例 #2
0
        public static bool? Show(string message, string detail, MessageBoxWindowType windowType, MessageBoxWindowButtonsType buttonType)
        {
            MessageBoxWindow window = new MessageBoxWindow();

              window.Message = message;
              window.Detail = detail;
              window.WindowType = windowType;
              window.ButtonsType = buttonType;

              switch (windowType)
              {
            case MessageBoxWindowType.Information:
              window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Information");
              break;
            case MessageBoxWindowType.Question:
              window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Question");
              break;
            case MessageBoxWindowType.Warning:
              window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Warning");
              break;
            case MessageBoxWindowType.Error:
              window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Error");
              break;
            default:
              window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Information");
              break;
              }

              return window.ShowDialog();
        }
コード例 #3
0
        public static bool? Show(string message, string detail, MessageBoxWindowType windowType, MessageBoxWindowButtonsType buttonType, string title)
        {
            MessageBoxWindow window = new MessageBoxWindow();

              window.Title = title;
              window.Message = message;
              window.Detail = detail;
              window.WindowType = windowType;
              window.ButtonsType = buttonType;

              return window.ShowDialog();
        }
コード例 #4
0
        public static bool?Show(string message, string detail, MessageBoxWindowType windowType, MessageBoxWindowButtonsType buttonType, string title)
        {
            MessageBoxWindow window = new MessageBoxWindow();

            window.Title       = title;
            window.Message     = message;
            window.Detail      = detail;
            window.WindowType  = windowType;
            window.ButtonsType = buttonType;

            return(window.ShowDialog());
        }
コード例 #5
0
        /// <summary>
        /// Converts a value.
        /// </summary>
        /// <param name="value">The value produced by the binding source.</param>
        /// <param name="targetType">The type of the binding target property.</param>
        /// <param name="parameter">The converter parameter to use.</param>
        /// <param name="culture">The culture to use in the converter.</param>
        /// <returns>
        /// A converted value. If the method returns null, the valid null value is used.
        /// </returns>
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }

            MessageBoxWindowType windowType = (MessageBoxWindowType)Enum.Parse(typeof(MessageBoxWindowType), value.ToString(), true);

            BitmapImage image = new BitmapImage();

            image.BeginInit();

            switch (windowType)
            {
            case MessageBoxWindowType.Question:
                image.UriSource = new Uri(@"pack://*****:*****@"pack://application:,,,/Gimela.Presentation.Windows;component/Resources/Images/MessageBoxIcons/warning.png", UriKind.Absolute);
                break;

            case MessageBoxWindowType.Error:
                image.UriSource = new Uri(@"pack://*****:*****@"pack://application:,,,/Gimela.Presentation.Windows;component/Resources/Images/MessageBoxIcons/information.png", UriKind.Absolute);
                break;
            }

            image.EndInit();

            return(image);
        }
コード例 #6
0
 public static bool? Show(string message, string detail, MessageBoxWindowType windowType, string title)
 {
     return Show(message, detail, windowType, MessageBoxWindowButtonsType.Ok, title);
 }
コード例 #7
0
        private static void MessageBoxTypeTranslator(ViewModelMessageBoxType messageBoxType, out MessageBoxWindowType windowType, out MessageBoxWindowButtonsType buttonType)
        {
            windowType = MessageBoxWindowType.Information;
              buttonType = MessageBoxWindowButtonsType.Ok;

              switch (messageBoxType)
              {
            case ViewModelMessageBoxType.Question:
              windowType = MessageBoxWindowType.Question;
              buttonType = MessageBoxWindowButtonsType.YesNo;
              break;
            case ViewModelMessageBoxType.Warning:
              windowType = MessageBoxWindowType.Warning;
              break;
            case ViewModelMessageBoxType.Error:
              windowType = MessageBoxWindowType.Error;
              break;
            case ViewModelMessageBoxType.None:
            case ViewModelMessageBoxType.Information:
            default:
              break;
              }
        }
コード例 #8
0
 public static bool?Show(string message, string detail, MessageBoxWindowType windowType, string title)
 {
     return(Show(message, detail, windowType, MessageBoxWindowButtonsType.Ok, title));
 }
コード例 #9
0
        private static void MessageBoxTypeTranslator(ViewModelMessageBoxType messageBoxType, out MessageBoxWindowType windowType, out MessageBoxWindowButtonsType buttonType)
        {
            windowType = MessageBoxWindowType.Information;
            buttonType = MessageBoxWindowButtonsType.Ok;

            switch (messageBoxType)
            {
            case ViewModelMessageBoxType.Question:
                windowType = MessageBoxWindowType.Question;
                buttonType = MessageBoxWindowButtonsType.YesNo;
                break;

            case ViewModelMessageBoxType.Warning:
                windowType = MessageBoxWindowType.Warning;
                break;

            case ViewModelMessageBoxType.Error:
                windowType = MessageBoxWindowType.Error;
                break;

            case ViewModelMessageBoxType.None:
            case ViewModelMessageBoxType.Information:
            default:
                break;
            }
        }