Example #1
0
        }                          //nn singleton

        //================================================================================
        static public MainForm start()
        {
            //data:
            validateDirs();
            loadConfig();

            //view:
            CajApp.mainForm    = new MainForm(config);
            CajApp.optionsForm = new frmOptions(config);

            //logic:
            string poeFolder = config.read(CajConfig.poeFolderPath);

            locations = new CajLocations(dataDir + locationsFolderName,
                                         mainForm.setLocationData, trace);
            locations.setPart(config.readInt(CajConfig.gamePart, 1));
            client = new CajClient(poeFolder, onLocationChange, trace);

            //first launch:
            if (poeFolder == "")
            {
                showOptions();
                optionsForm.onFirstLaunch();
            }

            //launch main timer:
            timer          = new System.Timers.Timer(updateTime);
            timer.Elapsed += new ElapsedEventHandler(OnTimerEvent);
            timer.Enabled  = true;

            tests();

            return(mainForm);
        }
Example #2
0
        /// <summary>
        ///     Display the application's Options dialog box
        /// </summary>
        private void ShowOptionsDialog()
        {
            if (_optionsForm == null)
            {
                Extractor extractor = Extractor.GetInstance(); //get a reference to the main Extractor engine
                mnuCtxExit.Enabled = false;                    //disable the Exit action on the system tray icon's menu
                //Stop();

                //display the application's Options form to the user
                _optionsForm = new frmOptions();
                _optionsForm.ShowDialog(this);

                extractor.LoadSettings();
                //ask the Extractor engine to refresh its settings from the application's user-config file

                //re-enable the Exit action on the system tray icon's menu
                mnuCtxExit.Enabled = true;

                //free the memory used by the reference to the Options form
                _optionsForm = null;
            }
            else
            {
                //if the Options form is already being displayed, just bring it to the front
                _optionsForm.BringToFront();
            }
        }
 void modeAndLoggingAction_Triggered(object sender, MMC.SyncActionEventArgs e)
 {
     try
     {
         frmOptions frm = new frmOptions();
         frm.storage         = this.storage;
         frm.mode            = this.storage.Mode;
         frm.logOnEventLog   = this.storage.LogOnEventLog;
         frm.logOnDb         = this.storage.LogOnDb;
         frm.logErrors       = this.storage.LogErrors;
         frm.logWarnings     = this.storage.LogWarnings;
         frm.logInformations = this.storage.LogInformations;
         DialogResult dr = this.SnapIn.Console.ShowDialog(frm);
         if (dr == DialogResult.OK)
         {
             this.storage.Mode            = frm.mode;
             this.storage.LogOnEventLog   = frm.logOnEventLog;
             this.storage.LogOnDb         = frm.logOnDb;
             this.storage.LogErrors       = frm.logErrors;
             this.storage.LogWarnings     = frm.logWarnings;
             this.storage.LogInformations = frm.logInformations;
             this.storage           = new SqlAzManStorage(frmStorageConnection.ConstructConnectionString(this.dataSource, this.initialCatalog, !(this.security == "Sql"), this.userId, this.password, this.otherSettings));
             this.SnapIn.IsModified = true;
             this.Render();
         }
     }
     catch (Exception ex)
     {
         this.ShowError(ex.Message + "\r\n" + Globalization.MultilanguageResource.GetString("StorageScopeNode_Msg30"), Globalization.MultilanguageResource.GetString("StorageScopeNode_Tit30"));
     }
 }
        private void btnGoOnForm_Click(object sender, EventArgs e)
        {
            List <CheckAccount> listAcc = new List <CheckAccount>();

            listAcc = checkAccountService.GetVerificationCode();
            foreach (var acc in listAcc)
            {
                if (acc.Code == txtVerificationCode.Text.Trim())
                {
                    this.Hide();
                    frmOptions           frm_Opn   = new frmOptions();
                    SendEmailToFrmOption sendEmail = new SendEmailToFrmOption(frm_Opn.FunDataOption);
                    sendEmail(_email);
                    checkAccountService.DeleteVerificationCode();
                    frm_Opn.ShowDialog();
                    break;
                }
                else
                {
                    _countVerification++;
                    txtVerificationCode.Clear();
                    btnGoOnForm.Enabled = false;
                    MessageBox.Show("Mã xác thực không đúng. Vui lòng kiểm tra lại. " + "\n" + "Bạn đã xác thực " + _countVerification
                                    + " lần. Nếu vượt quá 3 lần tài khoản sẻ bị khóa", "Thông Báo",
                                    MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    this.lblNote.ForeColor = Color.Red;
                    lblNote.Text           = "Mã Xác Thực không tồn tại. Còn " + (3 - _countVerification) + " lần xác thực trước khi tài khoản bị khóa.";
                    if (_countVerification > 3)
                    {
                        LockAccount();
                    }
                }
            }
        }
Example #5
0
        protected override void OnClick()
        {
            try
            {
                frmOptions frm = new frmOptions();
                if (frm.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    ESRI.ArcGIS.esriSystem.IUID pUI = new ESRI.ArcGIS.esriSystem.UID();
                    pUI.Value = ThisAddIn.IDs.ucProjectExplorer;

                    ESRI.ArcGIS.Framework.IDockableWindow docWin = ArcMap.DockableWindowManager.GetDockableWindow((ESRI.ArcGIS.esriSystem.UID)pUI);
                    if (docWin is ESRI.ArcGIS.Framework.IDockableWindow)
                    {
                        try
                        {
                            // Try and refresh the project window.
                            ucProjectExplorer.AddinImpl winImpl = ESRI.ArcGIS.Desktop.AddIns.AddIn.FromID <ucProjectExplorer.AddinImpl>(ThisAddIn.IDs.ucProjectExplorer);
                            winImpl.UI.RefreshBaseMaps();
                        }
                        catch (Exception ex)
                        {
                            ErrorHandling.frmException.HandleException(ex, "Error showing project explorer.", string.Empty);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ErrorHandling.frmException.HandleException(ex, "Error Showing RAVE Options Form", string.Empty);
            }

            ArcMap.Application.CurrentTool = null;
        }
Example #6
0
 private void btnOptions_Click(object sender, EventArgs e)
 {
     using (var frm = new frmOptions())
     {
         frm.ShowDialog(this);
     }
 }
Example #7
0
        private void butOptions_Click(object sender, EventArgs e)
        {
            frmOptions frm = new frmOptions(this);

            frm.ShowDialog(this);
            frm.Dispose();
            UpdateOptions();
        }
Example #8
0
        private void toolsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmOptions frm = new frmOptions(this);

            frm.ShowDialog(this);
            frm.Dispose();
            UpdateOptions();
        }
Example #9
0
 public void initControls()
 {
     bsModule.CurrentChanged += bsModule_CurrentChanged;
     ctrlSteps.initControl(this.dsModuleStructure, bsModule);
     ctrlTools.initControl(this.dsModuleStructure, bsModule);
     ctrlProtocolsView.initControl(this.dsModuleStructure);
     option = new frmOptions(this.dsModuleStructure);
 }
Example #10
0
        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Cursor = Cursors.WaitCursor;
            frmOptions frmOptions = new frmOptions();

            frmOptions.ShowDialog(this);
            Cursor = Cursors.Default;
        }
Example #11
0
 public void Teardown()
 {
     _optionsForm.Dispose();
     while (_optionsForm.Disposing)
     {
         ;
     }
     _optionsForm = null;
 }
Example #12
0
 protected override void OnOptionsFormOpeningRequested()
 {
     using (frmOptions frmOptions = new frmOptions())
     {
         frmOptions.LoadLabels();
         frmOptions.LoadConfiguration();
         frmOptions.ShowDialog(_view.WindowInstance);
     }
 }
Example #13
0
        private void button2_Click(object sender, EventArgs e)
        {
            frmOptions optionsForm = new frmOptions();

            optionsForm.Options = m_options;
            if (optionsForm.ShowDialog(this) == DialogResult.OK)
            {
                m_options = optionsForm.Options;
            }
        }
Example #14
0
    // This sub is the first one that executes when the Screen Saver
    //   program is run.  Since Windows will pass parameters to the this
    //   program whenever a user is setting up the screen saver using the
    //   Display Properties -> Screen Saver property screen.
    [STAThread()] static void Main(string[] args)
    {
        // Check to see if there were any passed arguments. if not, then
        //   the user simply double-clicked on the .scr file.

        if (args.Length > 0)
        {
            // This means we have some passed arguments.  Windows will
            //   automatically pass a "/s", "/p" or a "/c" depending
            //   on how the screen saver should behave.  The meanings for each
            //   of these parameters is seen below.
            // Check to see if the Screen saver should preview.

            if (args[0].ToLower() == "/p")
            {
                // This functionality is not implemented here because it involves
                //   creating and joining threads and is beyond the scope of this
                //   How-To.
                // Simply exit the application
                Application.Exit();
            }
            // Check to see if the Screen saver should show user definable options.
            if (args[0].ToLower().Trim().Substring(0, 2) == "/c")
            {
                // Create a frmOptions form and display it.
                frmOptions userOptionsForm = new frmOptions();
                userOptionsForm.ShowDialog();
                // Exit the application.
                Application.Exit();
            }

            // Check to see if the Screen saver should simply execute
            if (args[0].ToLower() == "/s")
            {
                // Create a frmSceenSaver form and display it.
                frmSceenSaver screenSaverForm = new frmSceenSaver();
                screenSaverForm.ShowDialog();
                // Exit the application when the form is closed
                Application.Exit();
            }
        }
        else
        {
            // Fire up the Screen saver.  Note: This is only used when the user
            //   Double clicks on the EXE, since otherwise windows passes a
            //   parameter to the application.
            // Create a frmSceenSaver form and display it.
            frmSceenSaver screenSaverForm = new frmSceenSaver();
            screenSaverForm.ShowDialog();
            // Exit the application when the form is closed
            Application.Exit();
        }
    }
        private async void DoImport()
        {
            TreeNode objSelectedNode = treCharacterList.SelectedNode;

            if (objSelectedNode == null || objSelectedNode.Level <= 0)
            {
                return;
            }
            int intIndex = Convert.ToInt32(objSelectedNode.Tag, GlobalOptions.InvariantCultureInfo);

            if (intIndex < 0 || intIndex >= _lstCharacterCache.Count)
            {
                return;
            }
            string strFile        = _lstCharacterCache[intIndex]?.FilePath;
            string strCharacterId = _lstCharacterCache[intIndex]?.CharacterId;

            if (string.IsNullOrEmpty(strFile) || string.IsNullOrEmpty(strCharacterId))
            {
                return;
            }
            string strFilePath = Path.Combine(Application.StartupPath, "settings", "default.xml");

            if (!File.Exists(strFilePath) &&
                Program.MainForm.ShowMessageBox(this, LanguageManager.GetString("Message_CharacterOptions_OpenOptions"), LanguageManager.GetString("MessageTitle_CharacterOptions_OpenOptions"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                using (new CursorWait(this))
                    using (frmOptions frmOptions = new frmOptions())
                        frmOptions.ShowDialog(this);
            }
            using (new CursorWait(this))
            {
                cmdImport.Enabled     = false;
                cmdSelectFile.Enabled = false;
                Character objCharacter = new Character();
                Program.MainForm.OpenCharacters.Add(objCharacter);
                //Timekeeper.Start("load_file");
                bool blnLoaded = await objCharacter.LoadFromHeroLabFile(strFile, strCharacterId);

                //Timekeeper.Finish("load_file");
                if (!blnLoaded)
                {
                    Program.MainForm.OpenCharacters.Remove(objCharacter);
                    cmdImport.Enabled     = true;
                    cmdSelectFile.Enabled = true;
                    return;
                }

                Program.MainForm.OpenCharacter(objCharacter);
            }

            Close();
        }
Example #16
0
        private void btnTiepTuc2_Click(object sender, EventArgs e)
        {
            string checkText = txtKetQua2.Text;

            if (checkText.Equals("Phải"))
            {
                MessageBox.Show("Hay Lắm Thằng Ngu ạ, Câu trả lời đúng r", "Đúng Rồi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                this.Hide();
                frmOptions frm_option = new frmOptions();
                frm_option.ShowDialog();
            }
            else
            {
                MessageBox.Show("M thông minh lắm thằng ngu ạ, Nhưng sai r", "Sai Rồi", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Example #17
0
        private void mbutton_options_Click(object sender, EventArgs e)
        {
            frmOptions options = new frmOptions();

            options.Options       = m_options;
            options.Icon          = ParentForm.Icon;
            options.StartPosition = FormStartPosition.CenterParent;
            DialogResult result = options.ShowDialog();

            if (result == DialogResult.OK)
            {
                if (!m_options.Equals(options.Options))
                {
                    UpdateAnalysis(options.Options);
                    mbutton_saveDatabase.Visible = false;
                }
            }
        }
Example #18
0
        static bool CATCHMENT_TEXTMAPPING(vdDocument vdoc)
        {
            string file_name = Path.Combine(ihapp.AppDataPath, "Storage_SurveyData.txt");

            if (File.Exists(file_name))
            {
                frmOptions frm = new frmOptions(vdoc, file_name);
                frm.Text          = "Catchment Area/Volume User's Guide";
                frm.Owner         = thisFrm;
                frm.StartPosition = FormStartPosition.CenterParent;
                frm.Show();
            }
            else
            {
                MessageBox.Show("\"Storage_SurveyData.txt\" file not found in Working Folder.", "HEADS", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            return(false);
        }
Example #19
0
 private void Settings(Office.CommandBarButton btn, ref bool cancel)
 {
     try
     {
         frmOptions myOptions = new frmOptions();
         myOptions.ShowDialog();
         if (myOptions.DialogResult == DialogResult.OK)
         {
             // Refresh the drop down items
             this.LoadDropDown();
             // Refresh the command bar
             this.ShowHideButtons();
         }
     }
     catch (System.Exception ex) // TODO we should not catch all exceptions
     {
         MessageBox.Show("caught: \r\n" + ex.ToString());
     }
 }
Example #20
0
 private void btnSettings_Click(object sender, RibbonControlEventArgs e)
 {
     try
     {
         frmOptions myOptions = new frmOptions();
         myOptions.ShowDialog();
         if (myOptions.DialogResult == DialogResult.OK)
         {
             // Refresh the drop down items
             this.LoadDropDown();
             // Refresh the command bar
             this.ShowHideButtons();
         }
     }
     catch (System.Exception ex) // TODO we should not catch all exceptions
     {
         MessageBox.Show("caught: \r\n" + ex.ToString());
     }
 }
Example #21
0
        protected override void OnOptionsFormOpeningRequested()
        {
            using (frmOptions frmOptions = new frmOptions())
            {
                frmOptions.LoadLabels();

                try
                {
                    frmOptions.LoadConfiguration();
                }
                catch
                {
                    MRCCompressorGlobals.ImageSaveAsPDFMRCActionConfiguration = ConfigurationManager.ResetDefaultImageSaveAsPDFMRCActionConfiguration();
                    frmOptions.LoadConfiguration();
                }

                frmOptions.ShowDialog(_view.WindowInstance);
            }
        }
Example #22
0
        /// <summary>
        /// Create a new character and show the Create Form.
        /// </summary>
        private void ShowNewForm(object sender, EventArgs e)
        {
            string strFilePath = Path.Combine(Application.StartupPath, "settings", "default.xml");

            if (!File.Exists(strFilePath))
            {
                if (MessageBox.Show(LanguageManager.GetString("Message_CharacterOptions_OpenOptions", GlobalOptions.Language), LanguageManager.GetString("MessageTitle_CharacterOptions_OpenOptions", GlobalOptions.Language), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    Cursor = Cursors.WaitCursor;
                    frmOptions frmOptions = new frmOptions();
                    frmOptions.ShowDialog();
                    Cursor = Cursors.Default;
                }
            }
            Cursor = Cursors.WaitCursor;
            Character objCharacter = new Character();
            string    settingsPath = Path.Combine(Application.StartupPath, "settings");

            string[] settingsFiles = Directory.GetFiles(settingsPath, "*.xml");

            if (settingsFiles.Length > 1)
            {
                frmSelectSetting frmPickSetting = new frmSelectSetting();
                frmPickSetting.ShowDialog(this);

                if (frmPickSetting.DialogResult == DialogResult.Cancel)
                {
                    return;
                }

                objCharacter.SettingsFile = frmPickSetting.SettingsFile;
            }
            else
            {
                string strSettingsFile = settingsFiles[0];
                objCharacter.SettingsFile = Path.GetFileName(strSettingsFile);
            }

            // Show the BP selection window.
            frmSelectBuildMethod frmBP = new frmSelectBuildMethod(objCharacter);

            frmBP.ShowDialog();
            Cursor = Cursors.Default;

            if (frmBP.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            if (objCharacter.BuildMethod == CharacterBuildMethod.Karma || objCharacter.BuildMethod == CharacterBuildMethod.LifeModule)
            {
                Cursor = Cursors.WaitCursor;
                frmKarmaMetatype frmSelectMetatype = new frmKarmaMetatype(objCharacter);
                frmSelectMetatype.ShowDialog();
                Cursor = Cursors.Default;

                if (frmSelectMetatype.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
            }
            // Show the Metatype selection window.
            else if (objCharacter.BuildMethod == CharacterBuildMethod.Priority || objCharacter.BuildMethod == CharacterBuildMethod.SumtoTen)
            {
                Cursor = Cursors.WaitCursor;
                frmPriorityMetatype frmSelectMetatype = new frmPriorityMetatype(objCharacter);
                frmSelectMetatype.ShowDialog();
                Cursor = Cursors.Default;

                if (frmSelectMetatype.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
            }
            Cursor = Cursors.WaitCursor;

            // Add the Unarmed Attack Weapon to the character.
            XmlDocument objXmlDocument = XmlManager.Load("weapons.xml");
            XmlNode     objXmlWeapon   = objXmlDocument.SelectSingleNode("/chummer/weapons/weapon[name = \"Unarmed Attack\"]");

            if (objXmlWeapon != null)
            {
                List <Weapon> lstWeapons = new List <Weapon>();
                Weapon        objWeapon  = new Weapon(objCharacter);
                objWeapon.Create(objXmlWeapon, lstWeapons);
                objWeapon.ParentID = Guid.NewGuid().ToString("D"); // Unarmed Attack can never be removed
                objCharacter.Weapons.Add(objWeapon);
                foreach (Weapon objLoopWeapon in lstWeapons)
                {
                    objCharacter.Weapons.Add(objLoopWeapon);
                }
            }

            frmCreate frmNewCharacter = new frmCreate(objCharacter)
            {
                MdiParent   = this,
                WindowState = FormWindowState.Maximized
            };

            frmNewCharacter.Show();

            objCharacter.CharacterNameChanged += objCharacter_CharacterNameChanged;
            Cursor = Cursors.Default;
        }
Example #23
0
 public static void Show(WindowType windowType)
 {
     try
     {
         if (windowType.Equals(WindowType.About))
         {
             if (aboutForm == null || aboutForm.IsDisposed)
             {
                 aboutForm  = new AboutWindow(aboutPanel);
                 aboutPanel = aboutForm;
             }
             aboutForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ActiveDirectoryImport))
         {
             if (adimportForm == null || adimportForm.IsDisposed)
             {
                 adimportForm  = new ActiveDirectoryImportWindow(adimportPanel);
                 adimportPanel = adimportForm;
             }
             adimportPanel.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Options))
         {
             using (var optionsForm = new frmOptions())
             {
                 optionsForm.ShowDialog(frmMain.Default.pnlDock);
             }
         }
         else if (windowType.Equals(WindowType.SSHTransfer))
         {
             sshtransferForm  = new SSHTransferWindow(sshtransferPanel);
             sshtransferPanel = sshtransferForm;
             sshtransferForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Update))
         {
             if (updateForm == null || updateForm.IsDisposed)
             {
                 updateForm  = new UpdateWindow(updatePanel);
                 updatePanel = updateForm;
             }
             updateForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Help))
         {
             if (helpForm == null || helpForm.IsDisposed)
             {
                 helpForm  = new HelpWindow(helpPanel);
                 helpPanel = helpForm;
             }
             helpForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ExternalApps))
         {
             if (externalappsForm == null || externalappsForm.IsDisposed)
             {
                 externalappsForm  = new ExternalToolsWindow(externalappsPanel);
                 externalappsPanel = externalappsForm;
             }
             externalappsForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.PortScan))
         {
             portscanForm  = new PortScanWindow(portscanPanel);
             portscanPanel = portscanForm;
             portscanForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.UltraVNCSC))
         {
             if (ultravncscForm == null || ultravncscForm.IsDisposed)
             {
                 ultravncscForm  = new UltraVNCWindow(ultravncscPanel);
                 ultravncscPanel = ultravncscForm;
             }
             ultravncscForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ComponentsCheck))
         {
             if (componentscheckForm == null || componentscheckForm.IsDisposed)
             {
                 componentscheckForm  = new ComponentsCheckWindow(componentscheckPanel);
                 componentscheckPanel = componentscheckForm;
             }
             componentscheckForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Announcement))
         {
             if (AnnouncementForm == null || AnnouncementForm.IsDisposed)
             {
                 AnnouncementForm  = new AnnouncementWindow(AnnouncementPanel);
                 AnnouncementPanel = AnnouncementForm;
             }
             AnnouncementForm.Show(frmMain.Default.pnlDock);
         }
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddExceptionStackTrace("App.Runtime.Windows.Show() failed.", ex);
     }
 }
Example #24
0
        /// <summary>
        /// Create a new character and show the Create Form.
        /// </summary>
        private void ShowNewForm(object sender, EventArgs e)
        {
            string strFilePath = Path.Combine(Environment.CurrentDirectory, "settings", "default.xml");

            if (!File.Exists(strFilePath))
            {
                if (MessageBox.Show(LanguageManager.Instance.GetString("Message_CharacterOptions_OpenOptions"), LanguageManager.Instance.GetString("MessageTitle_CharacterOptions_OpenOptions"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                {
                    frmOptions frmOptions = new frmOptions();
                    frmOptions.ShowDialog();
                }
            }
            Character objCharacter = new Character();
            string    settingsPath = Path.Combine(Environment.CurrentDirectory, "settings");

            string[] settingsFiles = Directory.GetFiles(settingsPath, "*.xml");

            if (settingsFiles.Length > 1)
            {
                frmSelectSetting frmPickSetting = new frmSelectSetting();
                frmPickSetting.ShowDialog(this);

                if (frmPickSetting.DialogResult == DialogResult.Cancel)
                {
                    return;
                }

                objCharacter.SettingsFile = frmPickSetting.SettingsFile;
            }
            else
            {
                string strSettingsFile = settingsFiles[0];
                objCharacter.SettingsFile = Path.GetFileName(strSettingsFile);
            }

            // Show the BP selection window.
            frmSelectBuildMethod frmBP = new frmSelectBuildMethod(objCharacter);

            frmBP.ShowDialog();

            if (frmBP.DialogResult == DialogResult.Cancel)
            {
                return;
            }
            if (objCharacter.BuildMethod == CharacterBuildMethod.Karma || objCharacter.BuildMethod == CharacterBuildMethod.LifeModule)
            {
                frmKarmaMetatype frmSelectMetatype = new frmKarmaMetatype(objCharacter);
                frmSelectMetatype.ShowDialog();

                if (frmSelectMetatype.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
            }
            // Show the Metatype selection window.
            else if (objCharacter.BuildMethod == CharacterBuildMethod.Priority || objCharacter.BuildMethod == CharacterBuildMethod.SumtoTen)
            {
                frmPriorityMetatype frmSelectMetatype = new frmPriorityMetatype(objCharacter);
                frmSelectMetatype.ShowDialog();

                if (frmSelectMetatype.DialogResult == DialogResult.Cancel)
                {
                    return;
                }
            }

            // Add the Unarmed Attack Weapon to the character.
            try
            {
                XmlDocument objXmlDocument = XmlManager.Instance.Load("weapons.xml");
                XmlNode     objXmlWeapon   = objXmlDocument.SelectSingleNode("/chummer/weapons/weapon[name = \"Unarmed Attack\"]");
                TreeNode    objDummy       = new TreeNode();
                Weapon      objWeapon      = new Weapon(objCharacter);
                objWeapon.Create(objXmlWeapon, objCharacter, objDummy, null, null);
                objCharacter.Weapons.Add(objWeapon);
            }
            catch
            {
            }

            frmCreate frmNewCharacter = new frmCreate(objCharacter);

            frmNewCharacter.MdiParent   = this;
            frmNewCharacter.WindowState = FormWindowState.Maximized;
            frmNewCharacter.Show();

            objCharacter.CharacterNameChanged += objCharacter_CharacterNameChanged;
        }
Example #25
0
        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmOptions frmOptions = new frmOptions();

            frmOptions.ShowDialog(this);
        }
Example #26
0
        private void toolStripMenuItemOptions_Click(object sender, EventArgs e)
        {
            var opts = new frmOptions(cache, config);

            opts.ShowDialog(this);
        }
Example #27
0
 public void Setup()
 {
     _optionsForm = new frmOptions();
     _optionsForm.Show();
 }
Example #28
0
 public static void Show(WindowType windowType)
 {
     try
     {
         if (windowType.Equals(WindowType.About))
         {
             if (_aboutForm == null || _aboutForm.IsDisposed)
             {
                 _aboutForm  = new AboutWindow(_aboutPanel);
                 _aboutPanel = _aboutForm;
             }
             _aboutForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ActiveDirectoryImport))
         {
             if (_adimportForm == null || _adimportForm.IsDisposed)
             {
                 _adimportForm  = new ActiveDirectoryImportWindow(_adimportPanel);
                 _adimportPanel = _adimportForm;
             }
             _adimportPanel.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Options))
         {
             using (var optionsForm = new frmOptions())
             {
                 optionsForm.ShowDialog(frmMain.Default.pnlDock);
             }
         }
         else if (windowType.Equals(WindowType.SSHTransfer))
         {
             SshtransferForm   = new SSHTransferWindow(_sshtransferPanel);
             _sshtransferPanel = SshtransferForm;
             SshtransferForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Update))
         {
             if (UpdateForm == null || UpdateForm.IsDisposed)
             {
                 UpdateForm  = new UpdateWindow(UpdatePanel);
                 UpdatePanel = UpdateForm;
             }
             UpdateForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.Help))
         {
             if (_helpForm == null || _helpForm.IsDisposed)
             {
                 _helpForm  = new HelpWindow(_helpPanel);
                 _helpPanel = _helpForm;
             }
             _helpForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ExternalApps))
         {
             if (_externalappsForm == null || _externalappsForm.IsDisposed)
             {
                 _externalappsForm  = new ExternalToolsWindow(_externalappsPanel);
                 _externalappsPanel = _externalappsForm;
             }
             _externalappsForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.PortScan))
         {
             _portscanForm  = new PortScanWindow(_portscanPanel);
             _portscanPanel = _portscanForm;
             _portscanForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.UltraVNCSC))
         {
             if (_ultravncscForm == null || _ultravncscForm.IsDisposed)
             {
                 _ultravncscForm  = new UltraVNCWindow(_ultravncscPanel);
                 _ultravncscPanel = _ultravncscForm;
             }
             _ultravncscForm.Show(frmMain.Default.pnlDock);
         }
         else if (windowType.Equals(WindowType.ComponentsCheck))
         {
             Runtime.MessageCollector.AddMessage(MessageClass.InformationMsg, "Showing ComponentsCheck window", true);
             if (_componentscheckForm == null || _componentscheckForm.IsDisposed)
             {
                 _componentscheckForm  = new ComponentsCheckWindow(_componentscheckPanel);
                 _componentscheckPanel = _componentscheckForm;
             }
             _componentscheckForm.Show(frmMain.Default.pnlDock);
         }
     }
     catch (Exception ex)
     {
         Runtime.MessageCollector.AddExceptionStackTrace("App.Runtime.Windows.Show() failed.", ex);
     }
 }
Example #29
0
        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmOptions OptionsInstance = new frmOptions();

            OptionsInstance.ShowDialog();
        }
Example #30
0
                public static void Show(Type WindowType,
                                        PortScanMode PortScanMode = PortScanMode.Normal)
                {
                    try
                    {
                        switch (WindowType)
                        {
                            case Type.About:
                                if (aboutForm == null || aboutPanel == null | aboutPanel.VisibleState==DockState.Unknown)
                                {
                                    aboutForm = new About(aboutPanel);
                                    aboutPanel = aboutForm;
                                    aboutForm.Show(frmMain.Default.pnlDock);
                                }
                                else
                                {
                                    aboutPanel.Focus();
                                    aboutPanel.Show();
                                    aboutPanel.BringToFront();
                                    aboutForm.Focus();
                                }
                                
                                break;
                            case Type.ADImport:
                                adimportForm = new ADImport(adimportPanel);
                                adimportPanel = adimportForm;
                                adimportPanel.Show(frmMain.Default.pnlDock);
                                break;
                            case Type.Options:
                                optionsForm = new frmOptions(optionsPanel);
                                optionsForm.Show(frmMain.Default.pnlDock);
                                break;
                            case Type.SaveAs:
                                saveasForm = new SaveAs(saveasPanel);
                                saveasPanel = saveasForm;
                                saveasForm.Show(frmMain.Default.pnlDock);
                                break;
                            case Type.SSHTransfer:
                                sshtransferForm = new SSHTransfer(sshtransferPanel);
                                sshtransferPanel = sshtransferForm;
                                sshtransferForm.Show(frmMain.Default.pnlDock);
                                break;
                            case Type.Update:
                                if (updateForm == null || updatePanel == null || updatePanel.VisibleState == DockState.Unknown)
                                {
                                    updateForm = new UI.Window.Update(updatePanel);
                                    updatePanel = updateForm;
                                    updateForm.Show(frmMain.Default.pnlDock);
                                }
                                else
                                {
                                    updatePanel.Focus();
                                    updatePanel.Show();
                                    updatePanel.BringToFront();
                                    updateForm.Focus();
                                }
                                break;
                            case Type.Help:
                                helpForm = new Help(helpPanel);
                                helpPanel = helpForm;
                                helpForm.Show(frmMain.Default.pnlDock);
                                break;
                            case Type.ExternalApps:
                                if (externalappsForm == null || externalappsPanel == null || externalappsPanel.VisibleState == DockState.Unknown)
                                {
                                    externalappsForm = new ExternalApps(externalappsPanel);
                                    externalappsPanel = externalappsForm;
                                    externalappsForm.Show(frmMain.Default.pnlDock);
                                }
                                else
                                {
                                    externalappsPanel.Focus();
                                    externalappsPanel.Show();
                                    externalappsPanel.BringToFront();
                                    externalappsForm.Focus();
                                }
                                break;
                            case Type.PortScan:
                                portscanForm = new PortScan(portscanPanel, PortScanMode);
                                portscanPanel = portscanForm;
                                portscanForm.Show(frmMain.Default.pnlDock);
                                break;
                            case Type.UltraVNCSC:
                                ultravncscForm = new UltraVNCSC(ultravncscPanel);
                                ultravncscPanel = ultravncscForm;
                                ultravncscForm.Show(frmMain.Default.pnlDock);
                                break;
                            case Type.ComponentsCheck:
                                if (componentscheckForm == null || componentscheckPanel == null || componentscheckPanel.VisibleState == DockState.Unknown)
                                {
                                    componentscheckForm = new ComponentsCheck(componentscheckPanel);
                                    componentscheckPanel = componentscheckForm;
                                    componentscheckForm.Show(frmMain.Default.pnlDock);
                                }
                                else
                                {
                                    componentscheckPanel.Focus();
                                    componentscheckPanel.Show();
                                    componentscheckPanel.BringToFront();
                                    componentscheckForm.Focus();
                                }

                                break;
                            case Type.Announcement:
                                AnnouncementForm = new UI.Window.Announcement(AnnouncementPanel);
                                AnnouncementPanel = AnnouncementForm;
                                AnnouncementForm.Show(frmMain.Default.pnlDock);
                                break;
                            case Type.ConnectionStatus:
                                connectionStatusForm = new ConnectionStatusForm();
                                componentscheckPanel = connectionStatusForm;
                                connectionStatusForm.Show(frmMain.Default.pnlDock);
                                break;
                            case Type.QuickText:

                                if (quicktextPanel != null && (quicktextForm == null || quicktextPanel == null | quicktextPanel.VisibleState == DockState.Unknown))
                                {
                                    quicktextForm = new QuickTextEdit(quicktextPanel);
                                    quicktextPanel = quicktextForm;
                                    quicktextForm.Show(frmMain.Default.pnlDock);
                                }
                                else
                                {
                                    quicktextPanel.Focus();
                                    quicktextPanel.Show();
                                    quicktextPanel.BringToFront();
                                    quicktextForm.Focus();
                                }
                                
                                break;
                        }
                    }
                    catch (Exception ex)
                    {
                        MessageCollector.AddMessage(MessageClass.ErrorMsg,
                                                    (string)
                                                    ("Show (Runtime.Windows) failed" +
                                                     Constants.vbNewLine + ex.Message), true);
                    }
                }
Example #31
0
        private async void DoImport()
        {
            TreeNode objSelectedNode = treCharacterList.SelectedNode;

            if (objSelectedNode != null && objSelectedNode.Level > 0)
            {
                int intIndex = Convert.ToInt32(objSelectedNode.Tag, GlobalOptions.InvariantCultureInfo);
                if (intIndex >= 0 && intIndex < _lstCharacterCache.Count)
                {
                    string strFile        = _lstCharacterCache[intIndex]?.FilePath;
                    string strCharacterId = _lstCharacterCache[intIndex]?.CharacterId;
                    if (!string.IsNullOrEmpty(strFile) && !string.IsNullOrEmpty(strCharacterId))
                    {
                        string strFilePath  = Path.Combine(Application.StartupPath, "settings", "default.xml");
                        Cursor objOldCursor = Cursor;
                        if (!File.Exists(strFilePath))
                        {
                            if (MessageBox.Show(LanguageManager.GetString("Message_CharacterOptions_OpenOptions"), LanguageManager.GetString("MessageTitle_CharacterOptions_OpenOptions"), MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
                            {
                                Cursor = Cursors.WaitCursor;
                                using (frmOptions frmOptions = new frmOptions())
                                    frmOptions.ShowDialog();
                                Cursor = objOldCursor;
                            }
                        }
                        Cursor                = Cursors.WaitCursor;
                        cmdImport.Enabled     = false;
                        cmdSelectFile.Enabled = false;
                        Character objCharacter  = new Character();
                        string    settingsPath  = Path.Combine(Application.StartupPath, "settings");
                        string[]  settingsFiles = Directory.GetFiles(settingsPath, "*.xml");

                        if (settingsFiles.Length > 1)
                        {
                            using (frmSelectSetting frmPickSetting = new frmSelectSetting())
                            {
                                frmPickSetting.ShowDialog(this);

                                if (frmPickSetting.DialogResult == DialogResult.Cancel)
                                {
                                    return;
                                }

                                objCharacter.SettingsFile = frmPickSetting.SettingsFile;
                            }
                        }
                        else
                        {
                            string strSettingsFile = settingsFiles[0];
                            objCharacter.SettingsFile = Path.GetFileName(strSettingsFile);
                        }

                        Program.MainForm.OpenCharacters.Add(objCharacter);
                        //Timekeeper.Start("load_file");
                        bool blnLoaded = await objCharacter.LoadFromHeroLabFile(strFile, strCharacterId, objCharacter.SettingsFile).ConfigureAwait(true);

                        //Timekeeper.Finish("load_file");
                        if (!blnLoaded)
                        {
                            Program.MainForm.OpenCharacters.Remove(objCharacter);
                            Cursor                = objOldCursor;
                            cmdImport.Enabled     = true;
                            cmdSelectFile.Enabled = true;
                            return;
                        }

                        Program.MainForm.OpenCharacter(objCharacter);
                        Close();
                    }
                }
            }
        }
Example #32
0
 public static void ShowUpdatesTab()
 {
     optionsForm = new frmOptions(optionsPanel);
     optionsForm.Show(frmMain.Default.pnlDock, 5);
 }