protected override void OnLoad(EventArgs e) { base.OnLoad(e); if (openSearchProviders != null) { foreach (var provider in openSearchProviders.Get()) { var providerName = new ListItem(HttpUtility.HtmlDecode(provider.Name), provider.Id); providerName.Attributes["moreresults"] = provider.CanShowMoreResults.ToString(CultureInfo.InvariantCulture); ProvidersList.Items.Add(providerName); } } else { ProvidersListDiv.Visible = false; ShowError("The OpenSearch Providers plugin is not activated!"); } }
protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); LoadProviders(); ProcessSubmitedData(providers); var providerList = providers.Get().OrderBy(p => p.Name).Select(provider => new SearchProviderPresenter(provider, providers, BaseUrl)).ToList(); Bind(providerList, true); SetControlStyles(); // Save to viewstate SaveProviders(); }
public void SetConfigurationPropertyValue(object value) { providers = new SearchProvidersList(value as String ?? String.Empty); foreach (var provider in providers.Get()) { var authentication = provider.Authentication as IEncrypted; if (authentication != null) { (authentication).InvokeEncryption(); } } SaveProviders(); }
private void MergeEncryptedFields(SearchProvidersList newvalue, SearchProvidersList oldvalue) { foreach (var newprovider in newvalue.Get()) { var oldprovider = oldvalue.Get(newprovider.Id); if (oldprovider == null) { continue; } var authentication = newprovider.Authentication as IEncrypted; if (authentication != null) { (authentication).UpdateEncryptedFields(oldprovider.Authentication); } } }