Beispiel #1
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);
            }
        }
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public static AsyncOperationManagerList GetInstance()
        {
            if (_instance == null)
            {
                _instance = new AsyncOperationManagerList();
            }

            return(_instance);
        }
Beispiel #3
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);
            }
        }
        private void InitializeData()
        {
            InitializeComponent();

            _connSettings = MyZillaSettingsDataSet.GetInstance();

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

            _asyncOpManager = AsyncOperationManagerList.GetInstance();
        }