Ejemplo n.º 1
0
        public FormNewVersion(string publishedVersion)
        {
            InitializeComponent();
            this.publishedMyZillaVersion = publishedVersion;

            this._appSettings = MyZillaSettingsDataSet.CreateInstance(Utils.UserAppDataPath);

            this.settings = _appSettings.GetGlobalSettings();

            chkDoNotRemindLater.Checked = !settings.CheckForUpdate;
        }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
        /// <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;
        }
Ejemplo n.º 4
0
        public static void ActivateLoadingForm()
        {
            // verify ShowLoadingForm in app global settings.
            _appSettings = MyZillaSettingsDataSet.GetInstance();

            TDSettings.GlobalSettingsRow appSettings = _appSettings.GetGlobalSettings();

            if (appSettings.ShowLoadingForm)
            {

                // open form status
                if ((FormContainer as MainForm).statusForm == null)
                {
                    FormStatus frm = new FormStatus();

                    frm.Show();

                }
                else
                {
                    (FormContainer as MainForm).statusForm.Show();
                }
            }
            else
            {
                // no code here.
            }
        }