/// <summary> /// Sets the automatically saved values for: /// 1.Form width and height /// 2.Tree view width /// </summary> private void SetUIParameters() { _appSettings = MyZillaSettingsDataSet.GetInstance(); settings = _appSettings.GetGlobalSettings(ScreenSize); this.Height = settings.MainFormHeight; this.Width = settings.MainFormWidth; this.Left = settings.MainFormLeft; this.Top = settings.MainFormTop; this.splitContainer1.SplitterDistance = settings.TreePanelWidth; //this.StartPosition = FormStartPosition.CenterScreen; _userTreePanelWidthLoaded = true; }
public MainForm() { try { InitializeComponent(); _appSettings = MyZillaSettingsDataSet.CreateInstance(Utils.UserAppDataPath); ScreenSize = Screen.GetWorkingArea(this); settings = _appSettings.GetGlobalSettings(ScreenSize); int splasherTop; int splasherLeft; if (settings.MainFormMaximized) { splasherTop = (ScreenSize.Height) / 2; splasherLeft = (ScreenSize.Width) / 2; this.WindowState = FormWindowState.Maximized; } else { splasherTop = settings.MainFormTop + settings.MainFormHeight / 2; splasherLeft = settings.MainFormLeft + settings.MainFormWidth / 2; } SplashManager.Show(typeof(FormSplash), splasherTop, splasherLeft); tBSI.OnRemoveTabEventHandler += new RemovingTabEventHandler(tBSI_OnRemoveTab); //if application fails to created needed folders, application will be closed if (String.IsNullOrEmpty(Utils.UserAppDataPath)) this.Close(); //Subscribe to the manager of the async operations _asyncOpManager = AsyncOperationManagerList.GetInstance(); _asyncOpManager.RefreshAsyncOperationListEvent += new EventHandler(asyncOpManager_RefreshAsyncOpListEvent); _asyncOpManager.RefreshAsyncOperationListEvent += new EventHandler(_asyncOpManager_SplashRefreshAsyncOpListEvent); //Subscribe to the catalogue manager _catalogManager = CatalogueManager.Instance(); _catalogManager.CatalogueEvent += new CatalogueManager.CataloguesEventHandler(_catalogManager_CatalogueEvent); Utils.FormContainer = this; // Splasher.Show(typeof(FormSplash), splasherTop, splasherLeft); } catch (Exception ex) { MyLogger.Write(ex, "MainForm", LoggingCategory.Exception); SplashManager.Close(); MessageBox.Show(ex.Message); this.Close(); } }
private void LoadGlobalSettings() { settings = _appSettings.GetGlobalSettings(); chkShowLoadingForm.Checked = settings.ShowLoadingForm; chkEditConfirm.Checked = settings.ConfirmSuccessfullyEditBug; chkShowBugsCount.Checked = settings.ShowBugsCount; txtPath.Text = settings.ReportFilesPath; }