CSharpTest.Net
ContextPath Property
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Serialization Namespace > Storage Class : ContextPath Property

Glossary Item Box

Retrieves the current context path of the store

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property ContextPath As String
C# 
public string ContextPath {get;}

Example

Library/Library.Test/TestStorage.cs

C#Copy Code
Assert.IsNull(Store.ContextPath);

using (Store.SetContext("a"))
{
    Assert.AreEqual("a", Store.ContextPath);
    using (Store.SetContext("b"))
        Assert.AreEqual("b", Store.ContextPath);
    Assert.AreEqual("a", Store.ContextPath);
}

Assert.IsNull(Store.ContextPath);

using (Store.SetContext("a"))
{
    Assert.AreEqual("a", Store.ContextPath);
    Store.SetContext("b");
    Assert.AreEqual("b", Store.ContextPath);
}

Assert.IsNull(Store.ContextPath);
VB.NETCopy Code
Assert.IsNull(Store.ContextPath)

Using Store.SetContext("a")
    Assert.AreEqual("a", Store.ContextPath)
    Using Store.SetContext("b")
        Assert.AreEqual("b", Store.ContextPath)
    End Using
    Assert.AreEqual("a", Store.ContextPath)
End Using

Assert.IsNull(Store.ContextPath)

Using Store.SetContext("a")
    Assert.AreEqual("a", Store.ContextPath)
    Store.SetContext("b")
    Assert.AreEqual("b", Store.ContextPath)
End Using

Assert.IsNull(Store.ContextPath)

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys