private void InitializeData()
        {
            InitializeComponent();

            _connSettings = MyZillaSettingsDataSet.GetInstance();

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

            _asyncOpManager = AsyncOperationManagerList.GetInstance();
        }
Beispiel #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();
            }
        }
Beispiel #3
0
        static void bkgExport_ProgressChanged(object sender, ProgressChangedEventArgs e)
        {
            BackgroundWorker bkgWork = sender as BackgroundWorker;

            if (_asyncOpManager == null)
            {
                _asyncOpManager = AsyncOperationManagerList.GetInstance();
            }
            switch (e.ProgressPercentage)
            {
                case 0:

                    _asyncOpManager.BeginOperation(bkgWork, Messages.GenerateReport , e.ProgressPercentage);

                    break;

                case 100:

                    _asyncOpManager.UpdateStatus(bkgWork, Messages.GenerateReport , e.ProgressPercentage);

                    break;

                default:

                    _asyncOpManager.UpdateStatus(bkgWork, Messages.GenerateReport , e.ProgressPercentage);

                    break;

            }
        }
Beispiel #4
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     );
            }
        }
Beispiel #5
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     );
            }
        }