public static void SaveProperties(SiteSettingsContext context, SiteSettingsPropertyValueCollection propertyValues) { Provider.SetPropertyValues(context, propertyValues); }
public override void SetPropertyValues(SiteSettingsContext context, SiteSettingsPropertyValueCollection collection) { if (context == null) { throw new ArgumentNullException(nameof(context)); } //this.ExecuteQuery( // query => // { // const StringComparison mode = StringComparison.InvariantCultureIgnoreCase; // var names = query.GetAllSettingNames(); // foreach (var item in collection.Where(prop => prop.IsDirty && !prop.Settings.ReadOnly)) // { // var propertyName = item.Settings.PropertyName; // var data = SerializeValue(item); // if (names.Any(name => String.Equals(name, propertyName, mode))) // { // query.UpdateSetting(propertyName, data); // } // else // { // query.InsertSetting(propertyName, data); // } // } // }, // true); }
public abstract void SetPropertyValues(SiteSettingsContext context, SiteSettingsPropertyValueCollection collection);
private void Initialize() { if (initialized) { return; } if (HostingEnvironment.IsHosted) { Host.CheckAspNetPermission(AspNetHostingPermissionLevel.Low, ""); } lock (locker) { if (!initialized) { try { var context = new SiteSettingsContext(); values = SiteSettings.GetPropertyValues(context, Properties); } finally { initialized = true; } } } }