public MessageBox(MessageTypes type, string title, string message, Exception e, bool suppressable, AViewWindow owner, IEmailSource email_source)
     : this(title, message, suppressable, owner, email_source) {
     switch (type) {
         case MessageTypes.Error:
             if (e != null) {
                 exceptionExpander.Visibility = System.Windows.Visibility.Visible;
                 exceptionText.Text = recurseExceptions(e);
                 if (e.GetType() == typeof(CommunicatableException)) {
                     submitButton.Visibility = System.Windows.Visibility.Visible;
                 } else {
                     submitButton.Visibility = System.Windows.Visibility.Visible;
                 }
             }
             closeButton.Visibility = System.Windows.Visibility.Visible;
             errorIcon.Visibility = System.Windows.Visibility.Visible;
             break;
         case MessageTypes.Info:
             okButton.Visibility = System.Windows.Visibility.Visible;
             infoIcon.Visibility = System.Windows.Visibility.Visible;
             break;
         case MessageTypes.Warning:
             okButton.Visibility = System.Windows.Visibility.Visible;
             warningIcon.Visibility = System.Windows.Visibility.Visible;
             break;
     }
 }
Beispiel #2
0
 public RestoreWindow(AViewWindow owner)
     : base(new RestoreProgramHandler(null, new Location.LocationsHandler()), owner)
 {
     InitializeComponent();
     Translator.WPF.TranslationHelpers.translateWindow(this);
     default_progress_color = restoreProgress.Foreground;
 }
Beispiel #3
0
 protected AProgramWindow(AProgramHandler program_handler, AViewWindow parent)
     : base(parent)
 {
     this.program_handler = program_handler;
     this.Loaded += new System.Windows.RoutedEventHandler(WindowLoaded);
     if (program_handler != null)
         this.Title = program_handler.program_title;
 }
        public ReportProblemWindow(AViewWindow owner)
            : base(owner)
        {
            InitializeComponent();
            TranslationHelpers.translateWindow(this);
            this.Icon = owner.Icon;

            uploadBtn.To = Core.submission_email;
            uploadBtn.Subject = "Problem Report";
            uploadBtn.Source = Core.settings;
        }
Beispiel #5
0
        public ReportWindow(AAnalyzer analyzer, AViewWindow owner)
            : base(owner)
        {
            InitializeComponent();
            TranslationHelpers.translateWindow(this);
            this.Icon = owner.Icon;
            this.analyzer = analyzer;
            reportTxt.Text = analyzer.report;

            uploadBtn.To = Core.submission_email;
            uploadBtn.Subject = "Game Data - " + analyzer.game.Title;
            uploadBtn.Message = analyzer.report;
            uploadBtn.Source = Core.settings;
        }
 public MessageBox(RequestEventArgs e, AViewWindow owner, IEmailSource email_source)
     : this(e.title, e.message, e.suppressable, owner, email_source) {
     this.e = e;
     switch (e.info_type) {
         case RequestType.Question:
             yesButton.Visibility = System.Windows.Visibility.Visible;
             noButton.Visibility = System.Windows.Visibility.Visible;
             questionIcon.Visibility = System.Windows.Visibility.Visible;
             break;
         default:
             this.DialogResult = false;
             throw new NotImplementedException();
     }
     this.Suppress.Content = Strings.GetLabelString("SuppressFurtherRequests");
 }
 public ChoiceWindow(RequestEventArgs e, AViewWindow owner)
     : base(owner, null) {
     InitializeComponent();
     this.Icon = owner.Icon;
     TranslationHelpers.translateWindow(this);
     int selected = 0;
     this.Title = e.title;
     messageGrp.Header = e.message;
     foreach (string add_me in e.options) {
         choiceCombo.Items.Add(add_me);
         if (add_me == e.default_option)
             choiceCombo.SelectedIndex = selected;
         selected++;
     }
 }
Beispiel #8
0
        public NewWindow(AViewWindow owner)
            : base(owner, Core.settings)
        {
            this.Owner = owner;
            //            var uriSource = new Uri(System.IO.Path.Combine(Core.ExecutablePath, "masgau.ico"), UriKind.Relative);
            //          this.Icon = new BitmapImage(uriSource);

            System.Drawing.Icon ico = Properties.Resources.MASGAUIcon;

            this.Icon = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(
                    ico.ToBitmap().GetHbitmap(),
                    IntPtr.Zero,
                    Int32Rect.Empty,
                    BitmapSizeOptions.FromEmptyOptions());
        }
Beispiel #9
0
        public static void beginRestore(AViewWindow parent, List<Archive> archives)
        {
            string extrasave = ProgressHandler.message;
            ProgressHandler.saveMessage();
            parent.hideInterface();
            if (archives.Count > 1 && !TranslatingRequestHandler.Request(RequestType.Question, "RestoreMultipleArchives").Cancelled) {
                Restore.RestoreProgramHandler.use_defaults = true;
            }

            foreach (Archive archive in archives) {
                if (Restore.RestoreProgramHandler.overall_stop) {
                    break;
                }

                Restore.RestoreWindow restore = new Restore.RestoreWindow(archive, parent);
                restore.ShowDialog();

                switch (restore.Result) {
                    case RestoreResult.Success:
                        Core.redetect_games = true;
                        break;
                    case RestoreResult.Cancel:
                    case RestoreResult.Failed:
                    case RestoreResult.ElevationFailed:
                        break;
                }
            }
            Restore.RestoreProgramHandler.use_defaults = false;
            Restore.RestoreProgramHandler.overall_stop = false;
            // Restore.RestoreProgramHandler.default_user = null;
            if (Restore.RestoreProgramHandler.unsuccesfull_restores.Count > 0) {
                StringBuilder fail_list = new StringBuilder();
                foreach (string failed in Restore.RestoreProgramHandler.unsuccesfull_restores) {
                    fail_list.AppendLine(failed);
                }
                TranslatingMessageHandler.SendError("RestoreSomeFailed", fail_list.ToString());
            }
            parent.showInterface();
            ProgressHandler.message = extrasave;
        }
        public MessageBox(string title, string message, bool suppressable, AViewWindow owner, IEmailSource email_source)
            : base(owner, email_source) {
            this.Icon = owner.Icon;
            InitializeComponent();

            if (email_source != null) {
                submitButton.From = email_source.EmailSender;
                submitButton.To = email_source.EmailRecipient;
				submitButton.Source = email_source;
            }

            TranslationHelpers.translateWindow(this);
            this.Title = title;
            messageLabel.Content = message;
            if (owner != null)
                this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
            else
                this.WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            if (suppressable)
                this.Suppress.Visibility = System.Windows.Visibility.Visible;


            StringBuilder body = new StringBuilder();
            body.AppendLine(this.Title);
            body.AppendLine();
            body.AppendLine(messageLabel.Content.ToString());
            body.AppendLine();
            body.AppendLine(exceptionText.Text);
            body.AppendLine();
            body.AppendLine(MessageHandler.getEnvironmentInfo());
            body.AppendLine();
            body.AppendLine();

            submitButton.Message = body.ToString();
            submitButton.Subject = "MASGAU Error - " + this.Title;
        }
 public MessageBox(MessageTypes type, string title, string message, bool suppressable, AViewWindow owner, IEmailSource email_source)
     : this(type, title, message, null, suppressable, owner, email_source) {
 }
 public MessageBox(MessageEventArgs e, AViewWindow owner, IEmailSource email_source)
     : this(e.type, e.title, e.message, e.exception, e.Suppressable, owner, email_source) {
     this.e = e;
 }