コード例 #1
0
 /// <summary>
 /// Persist inputs provided on the UI
 /// </summary>
 private void PersistOptions()
 {
     try
     {
         this.optionSelection.VMSpecsSkipLines                  = int.Parse(cboVMSpecsSkipLines.SelectedValue.ToString());
         this.optionSelection.InputOverrideSkipLines            = int.Parse(cboOverrideSpecsSkipLines.SelectedValue.ToString());
         this.optionSelection.MappingCoefficientCoresSelection  = double.Parse(cboMappingCoefCores.SelectedValue.ToString());
         this.optionSelection.MappingCoefficientMemorySelection = double.Parse(cboMappingCoefMemory.SelectedValue.ToString());
         this.optionSelection.OSDiskHDDSelection                = cboOSDiskHDDSize.SelectedValue.ToString();
         this.optionSelection.OSDiskSSDSelection                = cboOSDiskSSDSize.SelectedValue.ToString();
         this.optionSelection.MemoryGBMBSelection               = cboMemoryGBMB.SelectedValue.ToString();
         this.optionSelection.HoursinaMonthSelection            = int.Parse(cboHoursinaMonth.SelectedValue.ToString());
         SavedDataUtil.SaveData(this.optionSelection, SavedDataUtil.GetConfigandOptionsDirName(), SavedDataUtil.GetOptionsFileName());
     }
     catch (Exception ex)
     {
         MessageBox.Show(UIStatusMessages.OptionsSaveFailed, ex.Message);
     }
 }
コード例 #2
0
        /// <summary>
        /// Persist the inputs provided on the UI
        /// </summary>
        private void PersistConfigDetails()
        {
            try
            {
                this.creds = new CSPAccountCreds()
                {
                    CSPPartnerTenantID     = string.IsNullOrWhiteSpace(txtPartnerTenantId.Text) ? string.Empty : txtPartnerTenantId.Text.Trim(),
                    CSPPartnerCenterAppId  = string.IsNullOrWhiteSpace(txtPCNativeAppId.Text) ? string.Empty : txtPCNativeAppId.Text.Trim(),
                    CSPAdminAgentUserName  = string.IsNullOrWhiteSpace(txtUsername.Text) ? string.Empty : txtUsername.Text.Trim(),
                    CSPAdminAgentPassword  = psPassword.Password,
                    CSPARMNativeAppId      = string.IsNullOrWhiteSpace(txtARMNativeAppId.Text) ? string.Empty : txtARMNativeAppId.Text.Trim(),
                    CSPCustomerTenantId    = string.IsNullOrWhiteSpace(txtCustomerTenantId.Text) ? string.Empty : txtCustomerTenantId.Text.Trim(),
                    CSPAzureSubscriptionId = string.IsNullOrWhiteSpace(txtCSPAzureSubId.Text) ? string.Empty : txtCSPAzureSubId.Text.Trim()
                };

                SavedDataUtil.SaveData <CSPAccountCreds>(this.creds, SavedDataUtil.GetConfigandOptionsDirName(), SavedDataUtil.GetConfigFileName());
            }
            catch (Exception ex)
            {
                MessageBox.Show(UIStatusMessages.ConfigSaveFailed, ex.Message);
            }
        }