public void AppStartup(object sender, StartupEventArgs e) { try { if (e.Args.Length > 0) { String _extenions = _extenions = Path.GetExtension(e.Args[0].ToLower()); if (_extenions == ".iso" || _extenions == ".pbp"/* || _extenions == ".jso" || _extenions == ".cso" || _extenions == ".dax"*/) { ViewerGame _Viewer = new ViewerGame(e.Args[0]); _Viewer.Show(); } else { MessageBox.Show("Cann't support this is extenions.", "Info:: PSP Library", MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK); Application.Current.Shutdown(); } } else { //String args = "D:\\[PSP Game]\\#NEW\\Final Fanasy 3\\Final Fanasy 3.iso"; //ViewerGame _Viewer = new ViewerGame(args); //_Viewer.Show(); MainWindow _WindowMain = new MainWindow(); _WindowMain.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message, "Warning:: PSP Library", MessageBoxButton.OK, MessageBoxImage.Asterisk, MessageBoxResult.OK); Application.Current.Shutdown(); } }
public void Show(MainWindow me, Boolean about) { this._MainWindow = me; this.Abouted = about; this.Viewed = true; this.Position(me); if (!about) { ImageAbout.Source = MainWindow.GetImage("Initialize.png"); GridAbout.Visibility = Visibility.Hidden; GridPreload.Visibility = Visibility.Visible; _SyncGame = new BackgroundWorker(); _SyncGame.WorkerReportsProgress = true; _SyncGame.WorkerSupportsCancellation = false; _SyncGame.DoWork += new DoWorkEventHandler(_SyncGame_DoWork); _SyncGame.ProgressChanged += new ProgressChangedEventHandler(_SyncGame_ProgressChanged); _SyncGame.RunWorkerCompleted += new RunWorkerCompletedEventHandler(_SyncGame_RunWorkerCompleted); _SyncGame.RunWorkerAsync(); } else { ImageAbout.Source = MainWindow.GetImage("About.png"); GridAbout.Visibility = Visibility.Visible; GridPreload.Visibility = Visibility.Hidden; } this.Topmost = true; this.ShowDialog(); }
public void Position(MainWindow me) { if (me.WindowState != WindowState.Maximized) { this.Top = (me.Top + me.Height / 2) - (this.Height / 2); this.Left = (me.Left + me.Width / 2) - (this.Width / 2); } else { this.Top = (Screen.PrimaryScreen.WorkingArea.Height / 2) - (this.Height / 2); this.Left = (Screen.PrimaryScreen.WorkingArea.Width / 2) - (this.Width / 2); } }