コード例 #1
0
ファイル: CatalogueManager.cs プロジェクト: resuarez/myzilla
        public NameValueCollection GetActiveConnections()
        {
            NameValueCollection activeConnections = new NameValueCollection();

            foreach (Catalogues catalogues in globalCataloguesCollection)
            {
                int connID = catalogues.ConnectionId;

                string connInfo = _appSettings.GetConnectionInfo(connID);

                activeConnections.Add(connID.ToString(), connInfo);
            }

            return(activeConnections);
        }
コード例 #2
0
        private void InsertBug_Load(object sender, EventArgs e)
        {
            try
            {
                if (!this.DesignMode)
                {
                    MyZillaSettingsDataSet _appSettings = MyZillaSettingsDataSet.GetInstance();

                    _catalogues = CatalogueManager.Instance();

                    this.txtReporter.Text = _appSettings.GetConnectionById(this.connectionId).UserName;

                    asyncOpManager = AsyncOperationManagerList.GetInstance();

                    cmbConnections.SelectedValueChanged -= new EventHandler(cmbConnections_SelectedValueChanged);

                    LoadConnectionInfo();

                    cmbConnections.Text = _appSettings.GetConnectionInfo(this.connectionId);

                    cmbConnections.SelectedValueChanged += new EventHandler(cmbConnections_SelectedValueChanged);


                    // verify if all catalogues have been added and populate the controls properly

                    cataloguesPerUser = _catalogues.GetCataloguesForConnection(this.connectionId);

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

                        cmbVersion.Enabled = false;

                        cmbMilestone.Enabled = false;

                        btnInsertBug.Enabled = false;

                        _catalogues.CompAndVersionCataloguesLoadedCompleted += new EventHandler(_catalogues_CompAndVersionCataloguesLoadedCompleted);

                        _catalogues.LoadCompAndVersionCatalogues(cataloguesPerUser);
                    }
                    else
                    {
                        _catalogues.DependentCataloguesLoadedCompleted += new EventHandler(this._catalogues_DependentCataloguesLoadedCompletedInsertBug);

                        PopulateControls();
                    }
                }
            }
            catch (Exception ex)
            {
                MyLogger.Write(ex, "InsertBug_Load", LoggingCategory.Exception);

                MessageBox.Show(this, ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
コード例 #3
0
        private static FormEditBug LoadForm(int bugId, int connectionId, Bug cachedBug)
        {
            // load form
            FormEditBug frmEditBug = null;

            try
            {
                frmEditBug = new FormEditBug(connectionId, bugId, cachedBug);

                if (frmEditBug.DialogResult == DialogResult.OK)
                {
                    //frmEditBug.Show();
                }

                if (frmEditBug.DialogResult == DialogResult.Cancel)
                {
                    MyZillaSettingsDataSet _appSettings = MyZillaSettingsDataSet.GetInstance();

                    string connInfo = _appSettings.GetConnectionInfo(connectionId);

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

                    MessageBox.Show(Utils.FormContainer, strMessage, Messages.Warning, MessageBoxButtons.OK, MessageBoxIcon.Warning);

                    frmEditBug = null;
                }
            }

            catch (Exception ex)
            {
                MyLogger.Write(ex, "LoadForm", LoggingCategory.Exception);

                MessageBox.Show(Utils.FormContainer, ex.Message, Messages.Error, MessageBoxButtons.OK, MessageBoxIcon.Error);

                if (frmEditBug != null)
                {
                    frmEditBug = null;

                    frmEditBug.Dispose();
                }
            }

            return(frmEditBug);
        }
コード例 #4
0
        private void LoadConnectionInfo()
        {
            MyZillaSettingsDataSet _appSettings = MyZillaSettingsDataSet.GetInstance();

            txtConnection.Text = _appSettings.GetConnectionInfo(_connectionID);
        }
コード例 #5
0
        private void ShowConnectionInfo()
        {
            MyZillaSettingsDataSet _appSettings = MyZillaSettingsDataSet.GetInstance();

            txtConnInfo.Text = _appSettings.GetConnectionInfo(this.connectionId);
        }