Visual Basic (Declaration) | |
---|---|
Public NotInheritable Class UserSettingsSubSection Inherits System.Configuration.ConfigurationElement |
C# | |
---|---|
public sealed class UserSettingsSubSection : System.Configuration.ConfigurationElement |
Library/Library.Test/TestUserSettings.cs
C# | Copy Code |
---|---|
UserSettingsSubSection section = new UserSettingsSubSection(); section.Name = "a"; Assert.AreEqual("a", section.Name); Assert.IsNotNull(section.Settings); Assert.IsNull(section["a"]); section["a"] = "b"; Assert.AreEqual("b", section["a"]); section["a"] = "c"; Assert.AreEqual("c", section["a"]); UserSettingsSubSection section2 = new UserSettingsSubSection(); section2.Name = "b"; Assert.AreNotEqual(0, section.CompareTo(section2)); section2.Name = "a"; Assert.AreEqual(0, section.CompareTo(section2)); section["a"] = "b"; section.Settings.Add("hello", "world"); section2.Settings.Add("hello", "universe"); Assert.AreEqual("universe", section2["hello"]); section2.CopyFrom(section); Assert.AreEqual("b", section2["a"]); Assert.AreEqual("world", section2["hello"]); |
VB.NET | Copy Code |
---|---|
Dim section As New UserSettingsSubSection() section.Name = "a" Assert.AreEqual("a", section.Name) Assert.IsNotNull(section.Settings) Assert.IsNull(section("a")) section("a") = "b" Assert.AreEqual("b", section("a")) section("a") = "c" Assert.AreEqual("c", section("a")) Dim section2 As New UserSettingsSubSection() section2.Name = "b" Assert.AreNotEqual(0, section.CompareTo(section2)) section2.Name = "a" Assert.AreEqual(0, section.CompareTo(section2)) section("a") = "b" section.Settings.Add("hello", "world") section2.Settings.Add("hello", "universe") Assert.AreEqual("universe", section2("hello")) section2.CopyFrom(section) Assert.AreEqual("b", section2("a")) Assert.AreEqual("world", section2("hello")) |
System.Object
System.Configuration.ConfigurationElement
CSharpTest.Net.AppConfig.UserSettingsSubSection
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
UserSettingsSubSection MembersCSharpTest.Net.AppConfig Namespace
UserSettingsSubSection UserSettingsSubSectionCollection.Item
Source Code
Library/AppConfig/UserSettingsSubSection.csUsed By
UserSettingsSubSection UserSettingsSubSectionCollection.Add(String)UserSettingsSubSectionCollection.CopyFrom(UserSettingsSubSectionCollection)