public FormGlobalSettings()
        {
            InitializeComponent();

            _appSettings = MyZillaSettingsDataSet.GetInstance();

            LoadGlobalSettings();
        }
Esempio n. 2
0
        /// <summary>
        /// Called once, when global data are instantiated.
        /// </summary>
        /// <param name="userPathData"></param>
        /// <returns></returns>
        public static MyZillaSettingsDataSet CreateInstance(string userPathData)
        {
            if (_instance == null)
            {
                _instance = new MyZillaSettingsDataSet(userPathData);
            }

            return(_instance);
        }
Esempio n. 3
0
        private CatalogueManager( )
        {
            _appSettings = MyZillaSettingsDataSet.GetInstance ();

            _appSettings.SaveSettings +=new EventHandler<MyZillaSettingsEventArgs>(_appSettings_SaveSettings);

            if (_appSettings.ConnectionType.Rows.Count == 0 )
            {
                _appSettings.AddConnectionType("Bugzilla");
            }
        }
Esempio n. 4
0
        public FormNewVersion(string publishedVersion)
        {
            InitializeComponent();
            this.publishedMyZillaVersion = publishedVersion;

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

            this.settings = _appSettings.GetGlobalSettings();

            chkDoNotRemindLater.Checked = !settings.CheckForUpdate;
        }
        private void InitializeData()
        {
            InitializeComponent();

            _connSettings = MyZillaSettingsDataSet.GetInstance();

            this.queryTree = ConfigItems.TDSQueriesTree.Instance();

            _asyncOpManager = AsyncOperationManagerList.GetInstance();
        }
Esempio n. 6
0
        /// <summary>
        /// Walks through the default folder structure store in the DefaultQueriesTree.xml
        /// and replicates the structure for the current connection
        /// </summary>
        /// <param name="Structure"></param>
        /// <param name="Connection"></param>
        public void BuildTreeStructureForUserId(TDSQueriesTree initialQueryTree, MyZillaSettingsDataSet.ConnectionRow  connectionRow)
        {
            foreach (TDSQueriesTree.FoldersRow folder in initialQueryTree.Folders.Rows)
            {
                CreateFolder(connectionRow, folder.Name, folder.LevelID, folder.ParentID);
            }
            _instance.Folders.AcceptChanges();

            RefreshTreePerUser(connectionRow );
        }
Esempio n. 7
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();
            }
        }
Esempio n. 8
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;
        }
Esempio n. 9
0
        private void EditBug_Load(object sender, EventArgs e)
        {
            try
            {
                if (!this.DesignMode)
                {

                    _appSettings = MyZillaSettingsDataSet.GetInstance();

                    _asyncOpManager = AsyncOperationManagerList.GetInstance();

                    // disable the control until de bug details are loaded and
                    // all the controls are populated accordingly.

                    ShowConnectionInfo();

                    this.Enabled = false;

                    _catalogues = CatalogueManager.Instance();

                    //if (_catalogues.DependentCataloguesLoadedCompleted!=null)
                        _catalogues.DependentCataloguesLoadedCompleted += new EventHandler(this._catalogues_DependentCataloguesLoadedCompleted);

                    cataloguesPerUser = _catalogues.GetCataloguesForConnection(this.connectionId);

                    if (cataloguesPerUser.catalogueComponent == null || cataloguesPerUser.catalogueVersion == null || cataloguesPerUser.catalogueTargetMilestone == null )
                    {
                        cmbComponent.Enabled = false;

                        cmbVersion.Enabled = false;

                        cmbMilestone.Enabled = false;

                        _catalogues.CompAndVersionCataloguesLoadedCompleted += new EventHandler(_catalogues_CompAndVersionCataloguesLoadedCompleted);

                        _catalogues.LoadCompAndVersionCatalogues(cataloguesPerUser);
                    }
                    else
                    {

                        PopulateControls();

                        // asyn op
                        GetBugDetailsAndSetControls(this.bugId, true);
                    }

                    if (_appSettings.GetConnectionById(connectionId).Version.StartsWith("2.18"))
                        GetLastUpdated();
                }
            }
            catch (Exception ex)
            {
                MyLogger.Write(ex, "EditBug_Load", LoggingCategory.Exception);

                MessageBox.Show(this, ex.Message, Messages.Error , MessageBoxButtons.OK, MessageBoxIcon.Error     );
            }
        }
Esempio n. 10
0
        public static string CheckIfValidConnection()
        {
            string result = string.Empty;

            if (_catManager == null)
            {
                _catManager = CatalogueManager.Instance();
            }

            Catalogues catalogues = _catManager.GetCataloguesForConnection(Utils.ConnectionId);

            if (catalogues == null)
            {
                // get the connection info
                if (_appSettings == null)
                {
                    _appSettings = MyZillaSettingsDataSet.GetInstance();
                }

                string connInfo = _appSettings.GetConnectionInfo(Utils.ConnectionId);

                result = string.Format(Messages.NoActiveConnection, connInfo);

            }

            return result;
        }
Esempio n. 11
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.
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Called once, when global data are instantiated.
        /// </summary>
        /// <param name="userPathData"></param>
        /// <returns></returns>
        public static MyZillaSettingsDataSet CreateInstance(string userPathData)
        {
            if (_instance == null)
            {
                _instance = new MyZillaSettingsDataSet(userPathData);
            }

            return _instance;
        }