Пример #1
0
        public object GetConfigurationPropertyValue()
        {
            EnsureChildControls();
            LoadProviders();
            var oldproviders = new SearchProvidersList(configurationData.GetCustomValue(OpenSearchPlugin.PropertyId.OpenSearch, String.Empty));

            MergeEncryptedFields(providers, oldproviders);
            return(providers != null?providers.ToXml() : String.Empty);
        }
Пример #2
0
 private void DeleteProvider(SearchProvidersList list, string data)
 {
     foreach (var idData in data.Split('&'))
     {
         int id;
         if (int.TryParse(idData, out id))
         {
             list.Remove(id.ToString(CultureInfo.InvariantCulture));
         }
     }
 }
Пример #3
0
        private void ProcessSubmitedData(SearchProvidersList list)
        {
            if (!String.IsNullOrEmpty(hdnProviderAction.Value) && !String.IsNullOrEmpty(hdnProviderData.Value))
            {
                switch (hdnProviderAction.Value)
                {
                case "add": InsertProvider(list, hdnProviderData.Value); break;

                case "delete": DeleteProvider(list, hdnProviderData.Value); break;
                }
            }
        }
Пример #4
0
 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();
 }
Пример #5
0
 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);
         }
     }
 }
 protected override void OnInit(EventArgs e)
 {
     this.openSearchProviders = OpenSearchPlugin.GetSearchProvidersList;
     EnsureChildControls();
     base.OnInit(e);
 }
Пример #7
0
 private void LoadProviders()
 {
     providers = new SearchProvidersList(hdnProviderList.Value);
 }
Пример #8
0
 private void InsertProvider(SearchProvidersList list, string data)
 {
     list.Add(new SearchProvider(data));
 }
Пример #9
0
 public SearchProviderPresenter(SearchProvider provider, SearchProvidersList providerList, string baseUrl)
 {
     this.provider     = provider;
     this.providerList = providerList;
     this.baseUrl      = baseUrl;
 }