CSharpTest.Net
Delete Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Serialization Namespace > INameValueStore Interface : Delete Method

path
Optional path for context information
name
The name of the property to remove

Glossary Item Box

Removes a property from the storage by name

Syntax

Visual Basic (Declaration) 
Sub Delete( _
   ByVal path As String, _
   ByVal name As String _
) 
C# 
void Delete( 
   string path,
   string name
)

Parameters

path
Optional path for context information
name
The name of the property to remove

Example

Library/Library.Test/TestSerializers.cs

C#Copy Code
string value;

Store.Write(null, "<?a", "b");

Assert.IsTrue(Store.Read(null, "<?a", out value));
Assert.AreEqual("b", value);

Assert.IsTrue(Store.Read(String.Empty, "<?a", out value));
Assert.AreEqual("b", value);

Store.Write(null, "<?a", "b");

Assert.IsTrue(Store.Read(null, "<?a", out value));
Assert.AreEqual("b", value);

Assert.IsTrue(Store.Read(String.Empty, "<?a", out value));
Assert.AreEqual("b", value);

Store.Write(">?1/\\", "<?a", "c");

Assert.IsTrue(Store.Read(String.Empty, "<?a", out value));
Assert.AreEqual("b", value);

Assert.IsTrue(Store.Read(">?1/\\", "<?a", out value));
Assert.AreEqual("c", value);

Store.Delete(">?1/\\", "<?a");
Assert.IsFalse(Store.Read(">?1/\\", "<?a", out value));

Store.Delete(null, "<?a");
Assert.IsFalse(Store.Read(null, "<?a", out value));
Assert.IsFalse(Store.Read(String.Empty, "<?a", out value));
VB.NETCopy Code
Dim value As String

Store.Write(Nothing, "<?a", "b")

Assert.IsTrue(Store.Read(Nothing, "<?a", value))
Assert.AreEqual("b", value)

Assert.IsTrue(Store.Read([String].Empty, "<?a", value))
Assert.AreEqual("b", value)

Store.Write(Nothing, "<?a", "b")

Assert.IsTrue(Store.Read(Nothing, "<?a", value))
Assert.AreEqual("b", value)

Assert.IsTrue(Store.Read([String].Empty, "<?a", value))
Assert.AreEqual("b", value)

Store.Write(">?1/\", "<?a", "c")

Assert.IsTrue(Store.Read([String].Empty, "<?a", value))
Assert.AreEqual("b", value)

Assert.IsTrue(Store.Read(">?1/\", "<?a", value))
Assert.AreEqual("c", value)

Store.Delete(">?1/\", "<?a")
Assert.IsFalse(Store.Read(">?1/\", "<?a", value))

Store.Delete(Nothing, "<?a")
Assert.IsFalse(Store.Read(Nothing, "<?a", value))
Assert.IsFalse(Store.Read([String].Empty, "<?a", value))

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys