Пример #1
0
        static ChoAppDomain()
        {
            //ChoApplication.Initialize();
            RegisterAppDomainEvents();
            string envPath = ChoEnvironmentSettings.GetConfigFilePath();
            ChoGlobalApplicationSettings x = ChoGlobalApplicationSettings.Me;

            ChoApplication.Refresh();
            ChoTypesManager.Initialize();
            ChoAbortableQueuedExecutionService asyncExecutionService = ChoAbortableQueuedExecutionService.Global;

            _Load();
        }
Пример #2
0
        public static void ShowWnd()
        {
            if (_isShown)
            {
                return;
            }

            _isShown = true;
            if (Environment.UserInteractive)
            {
                if (!ChoServiceCommandLineArgs.HasServiceParams())
                {
                    if (ChoApplication.ApplicationMode == ChoApplicationMode.Windows ||
                        ChoApplication.ApplicationMode == ChoApplicationMode.Console)
                    {
                        if (!ChoAppFrxSettings.Me.DoNotShowEnvSelectionWnd)
                        {
                            ChoEnvironmentDetails environmentDetails = null;

                            ChoSharedEnvironmentManager sharedEnvironmentManager = new ChoSharedEnvironmentManager();
                            environmentDetails = ChoEnvironmentSettings.GetEnvironmentDetails();
                            if (environmentDetails != null)
                            {
                                if (environmentDetails.Freeze)
                                {
                                    return;
                                }
                            }

                            if (sharedEnvironmentManager.EnvironmentDetails != null &&
                                sharedEnvironmentManager.EnvironmentDetails.Length >= 1)
                            {
                                if (sharedEnvironmentManager.EnvironmentDetails.Length == 1)
                                {
                                    return;
                                }

                                ChoChooseEnvironmentFrm frm1 = new ChoChooseEnvironmentFrm();
                                if (frm1.ShowDialog() == System.Windows.Forms.DialogResult.Cancel)
                                {
                                    Environment.Exit(-101);
                                }
                            }
                        }
                    }
                }
            }
        }
Пример #3
0
        private void ChoChooseEnvironmentFrm_Load(object sender, EventArgs e)
        {
            ChoEnvironmentDetails environmentDetails = null;

            this.ActiveControl = cmbEnvironments;

            ChoSharedEnvironmentManager sharedEnvironmentManager = new ChoSharedEnvironmentManager();

            environmentDetails = ChoEnvironmentSettings.GetEnvironmentDetails();
            if (environmentDetails != null)
            {
                if (environmentDetails.Freeze)
                {
                    btnOK_Click(this, null);
                    return;
                }
            }

            if (sharedEnvironmentManager.EnvironmentDetails != null &&
                sharedEnvironmentManager.EnvironmentDetails.Length >= 1)
            {
                _bs.DataSource                = new List <ChoEnvironmentDetails>(sharedEnvironmentManager.EnvironmentDetails);
                cmbEnvironments.DataSource    = _bs;
                cmbEnvironments.DisplayMember = "Name";
                cmbEnvironments.ValueMember   = "Name";

                txtEnvComment.DataBindings.Add("Text", _bs, "Comment");

                if (sharedEnvironmentManager.EnvironmentDetails.Length == 1)
                {
                    btnOK_Click(this, null);
                }

                if (environmentDetails != null)
                {
                    cmbEnvironments.SelectedItem = environmentDetails.Name;
                }
            }
            else
            {
                btnOK_Click(this, null);
            }
        }