private void linkLabel_viewAuthorizationKey_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { var f = new FormPasswordCheck { label_message = { Text = @"It is required to retype the password that is present in the ‘Connection Credentials’ to view the Authorization key" } }; f.ShowDialog(); if (f.Saved) { if (f.textBox_password.Text == textBox_password.Text) { MessageBox.Show(this, @"Authorization key: " + textBox_authKey.Text, @"TAUS Search", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { MessageBox.Show(this, @"Unable to view Authorization key; the password does not match the one specified in the ‘Connection Credentials’", "TAUS Search", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } }
private void button_saveGlobalSettings_Click(object sender, EventArgs e) { var f = new FormPasswordCheck(); f.ShowDialog(); if (!f.Saved) { return; } if (f.textBox_password.Text == textBox_password.Text) { #region | save information to the plugin default settings | Options.ConnectionAppKey = textBox_applicationKey.Text; Options.ConnectionUserName = textBox_userName.Text; Options.ConnectionUserPassword = textBox_password.Text; Options.ConnectionAuthKey = textBox_authKey.Text; Options.SearchCriteriaContentTypeId = numericUpDown_contentTypeId.Value.ToString(CultureInfo.InvariantCulture); Options.SearchCriteriaContentTypeName = comboBox_contentType.SelectedItem.ToString(); Options.SearchCriteriaIndustryId = numericUpDown_industryId.Value.ToString(CultureInfo.InvariantCulture); Options.SearchCriteriaIndustryName = comboBox_industry.SelectedItem.ToString(); Options.SearchCriteriaOwnerId = numericUpDown_ownerId.Value.ToString(CultureInfo.InvariantCulture); Options.SearchCriteriaOwnerName = label_owner_name.Text; Options.SearchCriteriaProviderId = numericUpDown_providerId.Value.ToString(CultureInfo.InvariantCulture); Options.SearchCriteriaProviderName = label_provider_name.Text; Options.SearchCriteriaProductId = numericUpDown_productId.Value.ToString(CultureInfo.InvariantCulture); Options.SearchCriteriaProductName = label_product_name.Text; Options.SearchTimeout = numericUpDown_searchTimeout.Value.ToString(CultureInfo.InvariantCulture); Options.IgnoreTranslatedSegments = checkBox_ignoreTranslatedSegments.Checked ? "True" : "False"; var tausTmProvider = new Processor(); var searchSettings = new SearchSettings(); searchSettings.Timeout = Convert.ToInt32(Options.SearchTimeout); searchSettings.IgnoreTranslatedSegments = Options.IgnoreTranslatedSegments; searchSettings.AppKey = Options.ConnectionAppKey; searchSettings.UserName = Options.ConnectionUserName; searchSettings.Password = Options.ConnectionUserPassword; searchSettings.AuthKey = Options.ConnectionAuthKey; searchSettings.IndustryId = Convert.ToInt64(Options.SearchCriteriaIndustryId) > 0 ? Options.SearchCriteriaIndustryId : string.Empty; searchSettings.ContentTypeId = Convert.ToInt64(Options.SearchCriteriaContentTypeId) > 0 ? Options.SearchCriteriaContentTypeId : string.Empty; searchSettings.ProviderId = Convert.ToInt64(Options.SearchCriteriaProviderId) > 0 ? Options.SearchCriteriaProviderId.ToString() : string.Empty; searchSettings.OwnerId = Convert.ToInt64(Options.SearchCriteriaOwnerId) > 0 ? Options.SearchCriteriaOwnerId : string.Empty; searchSettings.ProductId = Convert.ToInt64(Options.SearchCriteriaProductId) > 0 ? Options.SearchCriteriaProductId : string.Empty; searchSettings.IndustryName = comboBox_industry.SelectedItem.ToString(); searchSettings.ContentTypeId = comboBox_contentType.SelectedItem.ToString(); searchSettings.ProviderId = label_provider_name.Text; searchSettings.OwnerId = label_owner_name.Text; searchSettings.ProductId = label_product_name.Text; tausTmProvider.SaveSettings(searchSettings); #endregion } else { MessageBox.Show(this, @"Unable to save the Global Settings; the password does not match the one specified in the ‘Connection Credentials’", "TAUS Search", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }