ElementInformation.IsLocked Property
.NET Framework (current version)
Gets a value that indicates whether the associated ConfigurationElement object cannot be modified.
Assembly: System.Configuration (in System.Configuration.dll)
Property Value
Type: System.Booleantrue if the associated ConfigurationElement object cannot be modified; otherwise, false.
The IsLocked property returns true when the related element is locked by the AllowOverride, AllowDefinition, or LockAllAttributesExcept property.
The following example shows how to use the IsLocked property.
static public void IsElementLocked() { // Get the current configuration file. System.Configuration.Configuration config = ConfigurationManager.OpenExeConfiguration( ConfigurationUserLevel.None); // Get the section. UrlsSection section = (UrlsSection)config.GetSection("MyUrls"); // Get the element. UrlConfigElement url = section.Simple; bool isLocked = url.ElementInformation.IsLocked; Console.WriteLine("Url element is locked? {0}", isLocked.ToString()); }
.NET Framework
Available since 2.0
Available since 2.0
Show: