Esempio n. 1
0
        private void LoadKompas3D_Click(object sender, EventArgs e)
        {
            if (LoadKompas3D.Enabled)
            {
                var errorCatcher = new ErrorCatcher();

                _kompasApp = new KompasApplication();
                if (_kompasApp == null)
                {
                    errorCatcher.CatchError(
                        ErrorCodes.KompasObjectCreatingError);
                }
                if (_kompasApp.LastErrorCode != ErrorCodes.OK)
                {
                    errorCatcher.CatchError(_kompasApp.LastErrorCode);
                    return;
                }

                SetAllInputsEnabledState(true);

                RunButton.Enabled = true;
                Defaults.Enabled  = true;

                WithoutHoleRadioButton.Enabled               = true;
                CrossheadScrewdriverRadioButton.Enabled      = true;
                FlatheadScrewdriverRadioButton.Enabled       = true;
                RegularPolygonScrewdriverRadioButton.Enabled = true;

                LoadKompas3D.Enabled  = false;
                CloseKompas3D.Enabled = true;
            }
        }
Esempio n. 2
0
        private void LoadKompas3D_Click(object sender, EventArgs e)
        {
            if (LoadKompas3D.Enabled)
            {
                var errorCatcher = new ErrorCatcher();

                // Создать образец приложения Kompas
                _kompasApp = new KompasApplication();
                if (_kompasApp == null)
                {
                    errorCatcher.CatchError(ErrorCodes.KompasObjectCreatingError);
                }
                if (_kompasApp.LastErrorCode != ErrorCodes.OK)
                {
                    errorCatcher.CatchError(_kompasApp.LastErrorCode);
                    return;
                }

                SetAllInputsEnabledState(true);

                RunButton.Enabled = true;

                LoadKompas3D.Enabled  = false;
                CloseKompas3D.Enabled = true;
            }
        }