예제 #1
0
        private void btnConnectIniPath_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.Filter = "Connect file (*.ini) | *.ini";
            openFileDialog.InitialDirectory = @"C:\";
            openFileDialog.Title = @"Выберите путь к файлу connect.ini";

            if (openFileDialog.ShowDialog() == DialogResult.OK)
            {
                tbConnectIniPath.Text = openFileDialog.FileName;

                IniParser parser = new IniParser(tbConnectIniPath.Text);
                String[] connectParameters = parser.EnumSection("CONNECT");
                cbConnectSectionName.Items.Clear();
                cbConnectSectionName.Items.AddRange(connectParameters);
                cbConnectSectionName.SelectedIndex = 0;
            }

            Repository.Flush();
        }
예제 #2
0
        private void FrmOptionsLoad(object sender, EventArgs e)
        {
            label1.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();
            CreateTextForLabelTest();

            if (Furniture.Helpers.SaveLoadSettings.ReadAppSettings("DBPath") == string.Empty)
            {
                txtDBPath.Text = Properties.Settings.Default.DBPath;
                Furniture.Helpers.SaveLoadSettings.AddOrUpdateAppSettings("DBPath", Properties.Settings.Default.DBPath);
            }
            else txtDBPath.Text = Furniture.Helpers.SaveLoadSettings.ReadAppSettings("DBPath");

            if (Furniture.Helpers.SaveLoadSettings.ReadAppSettings("DrwPath") == string.Empty)
            {
                txtDrwPath.Text = Properties.Settings.Default.DrwPath;
                Furniture.Helpers.SaveLoadSettings.AddOrUpdateAppSettings("DrwPath", Properties.Settings.Default.DrwPath);
            }
            else txtDrwPath.Text = Furniture.Helpers.SaveLoadSettings.ReadAppSettings("DrwPath");

            if (Furniture.Helpers.SaveLoadSettings.ReadAppSettings("ModelPath") == string.Empty)
            {
                txtModelPath.Text = Properties.Settings.Default.ModelPath;
                Furniture.Helpers.SaveLoadSettings.AddOrUpdateAppSettings("ModelPath", Properties.Settings.Default.ModelPath);
            }
            else txtModelPath.Text = Furniture.Helpers.SaveLoadSettings.ReadAppSettings("ModelPath");

            if (Furniture.Helpers.SaveLoadSettings.ReadAppSettings("DecorPath") == string.Empty)
            {
                txtDecorPath.Text = Properties.Settings.Default.DecorPath;
                Furniture.Helpers.SaveLoadSettings.AddOrUpdateAppSettings("DecorPath", Properties.Settings.Default.DecorPath);
            }
            else txtDecorPath.Text = Furniture.Helpers.SaveLoadSettings.ReadAppSettings("DecorPath");

            txtDesigner.Text = Properties.Settings.Default.Designer;
            //lblFtpPath.Text += @" " + Properties.Settings.Default.FtpPath;
            lblFtpPath.Text += @" " + ftpResult;

            lblPatchVersion.Text += @" " + Properties.Settings.Default.PatchVersion;

            chkAutoSaveComponents.Checked = Properties.Settings.Default.AutoSaveComponents;
            chkAutoSaveDrawings.Checked = Properties.Settings.Default.AutoSaveDrawings;
            chkAutoShowSetParameters.Checked = Properties.Settings.Default.AutoShowSetParameters;
            chkAutoCutOff.Checked = Properties.Settings.Default.AutoCutOff;
            chBxCvtCrss.Checked = Properties.Settings.Default.CheckCavitiesCross;
            chBxPrmLmts.Checked = Properties.Settings.Default.CheckParamLimits;
            chckBxUpdateLib.Checked = Properties.Settings.Default.CheckUpdateLib;

            btnIpdateLib.Enabled = Properties.Settings.Default.CheckUpdateLib;

            chckBxConvertDwgPdf.Checked = Properties.Settings.Default.ConvertToDwgPdf;
            if (Properties.Settings.Default.CashModeOn)
            {
                Properties.Settings.Default.ImmediatelyDetachModel = false;
                chckBxDetachModel.Checked = Properties.Settings.Default.ImmediatelyDetachModel;
                chckBxDetachModel.Enabled = false;
            }
            else
            {
                chckBxDetachModel.Checked = Properties.Settings.Default.ImmediatelyDetachModel;
                chckBxDetachModel.Enabled = true;
            }

            chckDefaultRPDView.Checked = Properties.Settings.Default.DefaultRPDView;
            chckBxReloadComps.Checked = Properties.Settings.Default.ReloadComponents;
            chckBxAutoScale.Checked = Properties.Settings.Default.ScaleWhenDimen;

            deleteBeforeDim.Checked = Properties.Settings.Default.DeleteBeforeDim;
            chbViewBeforeDim.Checked = Properties.Settings.Default.ViewsBeforeDimen;
            chbDeleteDrawIfStandart.Checked = Properties.Settings.Default.DeleteDraftIfStandart;

            chkAutoRecalculateOnAdd.Checked = Properties.Settings.Default.AutoRecalculateOnAdd;
            chkColorNotUniq.Checked = Properties.Settings.Default.SetDecorsFromFirstElement;
            chkShowRPDBeforeEnd.Checked = Properties.Settings.Default.ShowRPDBefore;
            chckBxAutoArrangeDimension.Checked = Properties.Settings.Default.AutoArrangeDimension;
            chckSetParent.Checked = Properties.Settings.Default.SetParentWindow;
            chckBxCreatePacketHoles.CheckedChanged -= PacketHolesCheckedChanged;
            chckBxCreatePacketHoles.Checked = Properties.Settings.Default.CreatePacketHoles;
            chckBxCreatePacketHoles.CheckedChanged += PacketHolesCheckedChanged;

            if (Furniture.Helpers.SaveLoadSettings.ReadAppSettings("ConnectIniPath") == string.Empty)
            {
                tbConnectIniPath.Text = Properties.Settings.Default.ConnectIniPath;
                //Furniture.Helpers.SaveLoadSettings.AddOrUpdateAppSettings("ConnectIniPath", Properties.Settings.Default.ConnectIniPath);
            }
            else tbConnectIniPath.Text = Furniture.Helpers.SaveLoadSettings.ReadAppSettings("ConnectIniPath");

            if (!String.IsNullOrEmpty(Furniture.Helpers.LocalAccounts.connectIniPath) && File.Exists(Furniture.Helpers.LocalAccounts.connectIniPath))
            {
                IniParser parser = new IniParser(Furniture.Helpers.LocalAccounts.connectIniPath);
                String[] connectParameters = parser.EnumSection("CONNECT");
                cbConnectSectionName.Items.Clear();
                cbConnectSectionName.Items.AddRange(connectParameters);
                cbConnectSectionName.SelectedItem = Properties.Settings.Default.ConnectParameterName;
            }

            tbOraDbLogin.Text = Properties.Settings.Default.OraDbLogin;
            tbOraDbPassword.Text = Properties.Settings.Default.OraDbPassword;
            ChkAutoSaveComponentsCheckedChanged(chkAutoSaveComponents, null);
        }