Пример #1
0
        private void BlobCredentials_Load(object sender, EventArgs e)
        {
            if (_dpiScaleFactor > 1)
            {
                //DPI
                float dpiScaleFactorFudged = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor;

                this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.38f));
                this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.6f);
                foreach (Control control in HighDPIUtils.GetChildInControl(this))
                {
                    control.Font = new Font(control.Font.FontFamily,
                                            control.Font.Size * dpiScaleFactorFudged * HighDPIUtils.PrimaryFudgeFactor,
                                            control.Font.Style);
                }
            }

            this.KeyPreview = true;

            txtConnectionName.Text = _connectionName;
            txtAccountKey.Text     = _accountKey;
            cboPrivacyLevel.Text   = "None";

            this.ActiveControl = txtAccountKey;
        }
Пример #2
0
        private void BlobCredentials_Load(object sender, EventArgs e)
        {
            if (_dpiScaleFactor > 1)
            {
                //DPI
                float dpiScaleFactorFudged = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor;

                if (Settings.Default.OptionHighDpiLocal)
                {
                    this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.38f));
                    this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.8f);
                    foreach (Control control in HighDPIUtils.GetChildInControl(this))
                    {
                        if (control is Button)
                        {
                            control.Font = new Font(control.Font.FontFamily,
                                                    control.Font.Size * dpiScaleFactorFudged * 1.1f * HighDPIUtils.PrimaryFudgeFactor,
                                                    control.Font.Style);
                            control.Left = control.Left - 90;
                            if (control.Name == "btnCancel")
                            {
                                control.Left = control.Left - 60;
                            }
                        }
                        else
                        {
                            control.Font = new Font(control.Font.FontFamily,
                                                    //cbw todo check * 1.4f works on remote desktop setting
                                                    control.Font.Size * dpiScaleFactorFudged * 1.4f * HighDPIUtils.PrimaryFudgeFactor,
                                                    control.Font.Style);
                        }

                        if (control is Button || control is TextBox || control is ComboBox)
                        {
                            control.Width = Convert.ToInt32(control.Width * 0.78);
                        }
                    }
                }
                else
                {
                    this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.38f));
                    this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.6f);
                    foreach (Control control in HighDPIUtils.GetChildInControl(this))
                    {
                        control.Font = new Font(control.Font.FontFamily,
                                                control.Font.Size * dpiScaleFactorFudged * HighDPIUtils.PrimaryFudgeFactor,
                                                control.Font.Style);
                    }
                }
            }

            this.KeyPreview = true;

            txtConnectionName.Text = _connectionName;
            txtAccountKey.Text     = _accountKey;
            cboPrivacyLevel.Text   = "None";

            this.ActiveControl = txtAccountKey;
        }
Пример #3
0
        private void ImpersonationCredentials_Load(object sender, EventArgs e)
        {
            //if (_dpiScaleFactor > 1)
            //{
            //    //DPI
            //    _dpiScaleFactor = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor;
            //    float fudgeFactor = HighDPIUtils.SecondaryFudgeFactor;
            //    this.Scale(new SizeF(_dpiScaleFactor, _dpiScaleFactor * fudgeFactor));
            //    this.Width = Convert.ToInt32(this.Width * _dpiScaleFactor);
            //    foreach (Control control in HighDPIUtils.GetChildInControl(this))
            //    {
            //        control.Font = new Font(control.Font.FontFamily,
            //                                control.Font.Size * _dpiScaleFactor * fudgeFactor,
            //                                control.Font.Style);
            //    }
            //}

            if (_dpiScaleFactor > 1)
            {
                //DPI
                float dpiScaleFactorFudged = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor;

                this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.38f));
                this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.6f);
                foreach (Control control in HighDPIUtils.GetChildInControl(this))
                {
                    control.Font = new Font(control.Font.FontFamily,
                                            control.Font.Size * dpiScaleFactorFudged * HighDPIUtils.PrimaryFudgeFactor,
                                            control.Font.Style);
                }
            }


            this.KeyPreview = true;

            switch (_authenticationKind)
            {
            case "Windows":
                this.Text = "Impersonation Credentials";
                break;

            default:
                this.Text = "Database Username & Password";
                break;
            }

            txtConnectionName.Text = _connectionName;
            txtUsername.Text       = _username;
            txtPassword.Text       = _password;

            this.ActiveControl = txtPassword;
        }
        private void Connections_Load(object sender, EventArgs e)
        {
            this.Width = Convert.ToInt32(this.Width * 1.3);

            if (_dpiScaleFactor > 1)
            {
                //DPI
                float dpiScaleFactorFudged = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor;
                float fudgeFactorWidth     = 0.95f;

                this.Scale(new SizeF(dpiScaleFactorFudged * (_dpiScaleFactor > 1.7 ? 1 : HighDPIUtils.SecondaryFudgeFactor), dpiScaleFactorFudged * HighDPIUtils.SecondaryFudgeFactor));
                this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * fudgeFactorWidth);
                foreach (Control control in HighDPIUtils.GetChildInControl(this)) //.OfType<Button>())
                {
                    if (control is GroupBox || control is Button)
                    {
                        control.Font = new Font(control.Font.FontFamily,
                                                control.Font.Size * dpiScaleFactorFudged * HighDPIUtils.SecondaryFudgeFactor,
                                                control.Font.Style);
                    }
                    if (control is GroupBox || control.Name == "btnSwitch")
                    {
                        control.Width = Convert.ToInt32(control.Width * dpiScaleFactorFudged * fudgeFactorWidth);
                    }
                    if (control is ComboBox)
                    {
                        control.Width = Convert.ToInt32(control.Width * fudgeFactorWidth);
                    }
                    if (control is Panel)
                    {
                        control.Left = Convert.ToInt32(control.Left * dpiScaleFactorFudged);
                    }
                }
                this.btnSwitch.Left = grpSource.Right + Convert.ToInt32(12 * dpiScaleFactorFudged);
                this.grpTarget.Left = btnSwitch.Right + Convert.ToInt32(12 * dpiScaleFactorFudged);
            }

            cboSourceServer.DataSource = ComparisonControl.ReverseArray <string>(Settings.Default.SourceServerAutoCompleteEntries.Substring(0, Settings.Default.SourceServerAutoCompleteEntries.Length - 1).Split("|".ToCharArray()));
            cboTargetServer.DataSource = ComparisonControl.ReverseArray <string>(Settings.Default.TargetServerAutoCompleteEntries.Substring(0, Settings.Default.TargetServerAutoCompleteEntries.Length - 1).Split("|".ToCharArray()));

            cboSourceDatabase.Text = Settings.Default.SourceCatalog;
            cboTargetDatabase.Text = Settings.Default.TargetCatalog;

            bool boundTargetDatabase = false;

            BindSourceConnectionInfo();
            BindTargetConnectionInfo(out boundTargetDatabase);
        }
        private void ImpersonationCredentials_Load(object sender, EventArgs e)
        {
            if (_dpiScaleFactor > 1)
            {
                //DPI
                float dpiScaleFactorFudged = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor;

                this.Scale(new SizeF(dpiScaleFactorFudged * 0.44f, dpiScaleFactorFudged * 0.38f));
                this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * 0.6f);
                foreach (Control control in HighDPIUtils.GetChildInControl(this))
                {
                    control.Font = new Font(control.Font.FontFamily,
                                            control.Font.Size * dpiScaleFactorFudged * HighDPIUtils.PrimaryFudgeFactor,
                                            control.Font.Style);
                }
            }

            this.KeyPreview = true;

            switch (_authenticationKind)
            {
            case "Windows":
                this.Text = "Impersonation Credentials";
                break;

            default:
                this.Text = "Database Username & Password";
                break;
            }

            txtConnectionName.Text = _connectionName;
            txtUsername.Text       = _username;
            txtPassword.Text       = _password;
            cboPrivacyLevel.Text   = "None";

            if (_privacyLevel == "NA")
            { //Fudge for provider data sources
                lblPrivacyLevel.Enabled = false;
                cboPrivacyLevel.Enabled = false;
            }

            this.ActiveControl = txtPassword;
        }
Пример #6
0
        private void Options_Load(object sender, EventArgs e)
        {
            if (_dpiScaleFactor > 1)
            {
                float dpiScaleFactorFudged = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor;
                //DPI
                this.Scale(new SizeF(dpiScaleFactorFudged * (_dpiScaleFactor > 1.7 ? 1 : HighDPIUtils.SecondaryFudgeFactor), dpiScaleFactorFudged * HighDPIUtils.SecondaryFudgeFactor));
                this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged);
                foreach (Control control in HighDPIUtils.GetChildInControl(this)) //.OfType<Button>())
                {
                    if (control is GroupBox || control is Button)
                    {
                        control.Font = new Font(control.Font.FontFamily,
                                                control.Font.Size * dpiScaleFactorFudged * HighDPIUtils.SecondaryFudgeFactor,
                                                control.Font.Style);
                    }
                }
                this.cboProcessingOption.Left = label1.Right + Convert.ToInt32(12 * dpiScaleFactorFudged);
            }

            this.KeyPreview             = true;
            chkMeasureDependencies.Text = "Display warnings for measure dependencies (DAX\nreference to missing measure/column)";

            chkPerspectives.Checked      = _comparisonInfo.OptionsInfo.OptionPerspectives;
            chkMergePerspectives.Checked = _comparisonInfo.OptionsInfo.OptionMergePerspectives;
            chkCultures.Checked          = _comparisonInfo.OptionsInfo.OptionCultures;
            chkMergeCultures.Checked     = _comparisonInfo.OptionsInfo.OptionMergeCultures;
            chkRoles.Checked             = _comparisonInfo.OptionsInfo.OptionRoles;
            //chkActions.Checked = _comparisonInfo.OptionsInfo.OptionActions;
            chkPartitions.Checked             = _comparisonInfo.OptionsInfo.OptionPartitions;
            chkRetainPartitions.Checked       = _comparisonInfo.OptionsInfo.OptionRetainPartitions;
            chkRetainPolicyPartitions.Checked = _comparisonInfo.OptionsInfo.OptionRetainPolicyPartitions;
            chkRetainStorageMode.Checked      = _comparisonInfo.OptionsInfo.OptionRetainStorageMode;
            chkMeasureDependencies.Checked    = _comparisonInfo.OptionsInfo.OptionMeasureDependencies;
            string processingOption = _comparisonInfo.OptionsInfo.OptionProcessingOption.ToString();

            cboProcessingOption.Text = processingOption == "DoNotProcess" ? "Do Not Process" : processingOption;
            //chkTransaction.Checked = _comparisonInfo.OptionsInfo.OptionTransaction;
            chkAffectedTables.Checked = _comparisonInfo.OptionsInfo.OptionAffectedTables;
        }
Пример #7
0
        private void ErrorMessage_Load(object sender, EventArgs e)
        {
            if (_dpiScaleFactor > 1)
            {
                //DPI
                _dpiScaleFactor = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor;
                float fudgeFactor = HighDPIUtils.SecondaryFudgeFactor;
                this.Scale(new SizeF(_dpiScaleFactor, _dpiScaleFactor * fudgeFactor));
                this.Width = Convert.ToInt32(this.Width * _dpiScaleFactor);
                foreach (Control control in HighDPIUtils.GetChildInControl(this))
                {
                    control.Font = new Font(control.Font.FontFamily,
                                            control.Font.Size * _dpiScaleFactor * fudgeFactor,
                                            control.Font.Style);
                }
            }

            txtErrorMessage.Text = _errorMessage;

            //do not want the OK button selected (closes inadvertently)
            txtErrorMessage.Focus();
            txtErrorMessage.SelectionStart  = 0;
            txtErrorMessage.SelectionLength = 0;
        }
Пример #8
0
        private void Connections_Load(object sender, EventArgs e)
        {
            if (_dpiScaleFactor > 1)
            {
                //DPI
                float dpiScaleFactorFudged = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor;
                float fudgeFactorWidth     = 0.95f;

                this.Scale(new SizeF(dpiScaleFactorFudged * (_dpiScaleFactor > 1.7 ? 1 : HighDPIUtils.SecondaryFudgeFactor), dpiScaleFactorFudged * HighDPIUtils.SecondaryFudgeFactor));
                this.Width = Convert.ToInt32(this.Width * dpiScaleFactorFudged * fudgeFactorWidth);
                foreach (Control control in HighDPIUtils.GetChildInControl(this)) //.OfType<Button>())
                {
                    if (control is GroupBox || control is Button)
                    {
                        control.Font = new Font(control.Font.FontFamily,
                                                control.Font.Size * dpiScaleFactorFudged * HighDPIUtils.SecondaryFudgeFactor,
                                                control.Font.Style);
                    }
                    if (control is GroupBox || control.Name == "btnSwitch")
                    {
                        control.Width = Convert.ToInt32(control.Width * dpiScaleFactorFudged * fudgeFactorWidth);
                    }
                    if (control is ComboBox)
                    {
                        control.Width = Convert.ToInt32(control.Width * fudgeFactorWidth);
                    }
                    if (control is Panel)
                    {
                        control.Left = Convert.ToInt32(control.Left * dpiScaleFactorFudged);
                    }
                }
                this.btnSwitch.Left = grpSource.Right + Convert.ToInt32(12 * dpiScaleFactorFudged);
                this.grpTarget.Left = btnSwitch.Right + Convert.ToInt32(12 * dpiScaleFactorFudged);
            }

            cboSourceServer.DataSource = ComparisonControl.ReverseArray <string>(Settings.Default.SourceServerAutoCompleteEntries.Substring(0, Settings.Default.SourceServerAutoCompleteEntries.Length - 1).Split("|".ToCharArray()));
            cboTargetServer.DataSource = ComparisonControl.ReverseArray <string>(Settings.Default.TargetServerAutoCompleteEntries.Substring(0, Settings.Default.TargetServerAutoCompleteEntries.Length - 1).Split("|".ToCharArray()));

            cboSourceDatabase.Text = Settings.Default.SourceCatalog;
            cboTargetDatabase.Text = Settings.Default.TargetCatalog;

            cboSourceProject.Items.Clear();
            cboTargetProject.Items.Clear();

            BindingSource projectsBindingSource = new BindingSource();
            BindingSource projectsBindingTarget = new BindingSource();

            _projects = new SortedList();

            if (_dte != null)
            {
                foreach (EnvDTE.Project project in _dte.Solution)
                {
                    IterateProject(_projects, project);
                }
            }

            if (_projects.Count == 0)
            {
                rdoSourceProject.Enabled = false;
                rdoTargetProject.Enabled = false;

                pnlSourceProject.Enabled = false;
                pnlTargetProject.Enabled = false;

                rdoSourceDb.Checked = true;
                rdoTargetDb.Checked = true;
            }
            else
            {
                rdoSourceProject.Enabled = true;
                rdoTargetProject.Enabled = true;

                projectsBindingSource.DataSource = _projects;
                projectsBindingTarget.DataSource = _projects;

                cboSourceProject.DataSource    = projectsBindingSource;
                cboSourceProject.ValueMember   = "Value";
                cboSourceProject.DisplayMember = "Key";

                cboTargetProject.DataSource    = projectsBindingTarget;
                cboTargetProject.ValueMember   = "Value";
                cboTargetProject.DisplayMember = "Key";

                bool boundTargetDatabase = false;
                if (!(BindSourceConnectionInfo() && BindTargetConnectionInfo(out boundTargetDatabase)))
                {
                    // Either new comparison with no existing connection info, or loaded from file but project not present

                    if (_projects.Count == 1)
                    {
                        //if only one project, default to only the source project dropdown active
                        rdoSourceProject.Checked = true;
                        pnlSourceProject.Enabled = true;

                        rdoTargetDb.Checked      = true;
                        pnlTargetProject.Enabled = false;
                    }
                    else
                    {
                        //if more than one project, default to both project dropdowns active
                        rdoSourceProject.Checked = true;
                        pnlSourceProject.Enabled = true;

                        rdoTargetProject.Checked = true;
                        pnlTargetProject.Enabled = true;

                        cboTargetProject.SelectedIndex = 1;
                    }
                }

                // We know there is at least 1 project, so unless bound target db from BSMN file, set target from source project configuration
                if (!boundTargetDatabase)
                {
                    SetTargetDatabaseFromSourceProjectConfiguration();
                }
            }

            _SetTargetDatabaseFromSourceProjectConfigurationAllowed = true;
        }
Пример #9
0
        private void Deploy_Load(object sender, EventArgs e)
        {
            try
            {
                //DPI
                if (_dpiScaleFactor > 1)
                {
                    float fudgedDpiScaleFactor = _dpiScaleFactor * HighDPIUtils.PrimaryFudgeFactor;

                    this.Scale(new SizeF(fudgedDpiScaleFactor, fudgedDpiScaleFactor));
                    picStatus.Scale(new SizeF(fudgedDpiScaleFactor, fudgedDpiScaleFactor));
                    gridProcessing.Scale(new SizeF(fudgedDpiScaleFactor * HighDPIUtils.SecondaryFudgeFactor, fudgedDpiScaleFactor * HighDPIUtils.SecondaryFudgeFactor));
                    this.Font = new Font(this.Font.FontFamily,
                                         this.Font.Size * fudgedDpiScaleFactor,
                                         this.Font.Style);
                    foreach (Control control in HighDPIUtils.GetChildInControl(this)) //.OfType<Button>())
                    {
                        if (control is DataGridView || control is Button)
                        {
                            control.Font = new Font(control.Font.FontFamily,
                                                    control.Font.Size * fudgedDpiScaleFactor,
                                                    control.Font.Style);
                        }
                    }
                    foreach (DataGridViewColumn col in gridProcessing.Columns)
                    {
                        col.Width = Convert.ToInt32(col.Width * fudgedDpiScaleFactor * 1.5f);
                    }
                    HighDPIUtils.ScaleStreamedImageListByDpi(DeployImageList);
                }

                this.KeyPreview = true;
                AddRow(_deployRowWorkItem, "Deploying ...");
                _deployStatus = DeploymentStatus.Deploying;

                _comparison.PasswordPrompt     += HandlePasswordPrompt;
                _comparison.BlobKeyPrompt      += HandleBlobPrompt;
                _comparison.DeploymentMessage  += HandleDeploymentMessage;
                _comparison.DeploymentComplete += HandleDeploymentComplete;

                btnStopProcessing.Enabled = false;
                btnClose.Enabled          = false;
                _errorMessageForm         = new ProcessingErrorMessage();

                ProcessingTableCollection tablesToProcess = _comparison.GetTablesToProcess();
                foreach (ProcessingTable table in tablesToProcess)
                {
                    AddRow(table.Name, "Processing in progress ...");
                }
                if (tablesToProcess.Count > 0)
                {
                    btnStopProcessing.Enabled = true;
                    lblStatus.Text            = "Processing ...";
                }
                _comparison.DatabaseDeployAndProcess(tablesToProcess);
            }
            catch (Exception exc)
            {
                MessageBox.Show(exc.Message, _comparisonInfo.AppName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }