/// <summary> /// Initializes a new instance of the <see cref="SessionStorageProviderElement" /> class. /// </summary> public SessionStorageProviderElement() : base() { _propUpdateInterval = new ConfigurationProperty("updateInterval", typeof(int), 1, ConfigurationPropertyOptions.None); _propStaleTimeout = new ConfigurationProperty("staleTimeout", typeof(int), 30 * 60, ConfigurationPropertyOptions.None); PropertiesInternal.Add(_propUpdateInterval); PropertiesInternal.Add(_propStaleTimeout); }
IDictionary <string, object> IPersistableObject.GetProperties() { // no need to Lock-Unlock because the underlying dictionary is changed by set or assignment only return(PropertiesInternal.ToDictionary(p => p.Key, p => { if (!CanGetProperty(p.Key)) { Throw.InvalidOperationException <object>(Res.ComponentModelCannotGetProperty(p.Key)); } return p.Value; })); }
IDictionary <string, object> IPersistableObject.GetProperties() { // no need to Lock-Unlock because the enumerator of the LockingDictionary is already a snapshot return(PropertiesInternal.ToDictionary(p => p.Key, p => { if (!CanGetProperty(p.Key)) { Throw.InvalidOperationException <object>(Res.ComponentModelCannotGetProperty(p.Key)); } return p.Value; })); }