C# / .Net API Library Reference  4.3.2-74-ge1d4cca
Public Functions | Properties
XmlStateLock Class Reference

The XmlStateLock class provides methods to interact with the PureWeb application state, once you have acquired a state lock (see AcquireLock).

When referring to a value in the application state tree, provide the entire path (except for the root element, which should be omitted), dividing each level using a slash, for example: /MainPage/TabX/ControlName. The path can also contain conditional operators:

Package Functions

Constructors and Destructors
 XmlStateLock (XmlStateManager stateManager, XmlState state)
 

Public Functions

void Dispose ()
 
XElement GetTree (string path)
 
XElement GetTree (string path, bool allowCreate)
 
string GetValue (string path)
 
GetValueAs< T > (string path)
 
GetValueAs< T > (string path, CultureInfo culture)
 
GetValueAs< T > (string path, T defaultValue)
 
GetValueAs< T > (string path, T defaultValue, CultureInfo culture)
 
void SetTree (string path, XElement element)
 
void SetValue (string path, object value)
 
override string ToString ()
 
string ToString (SaveOptions options)
 

Properties

string this[string path] [get, set]
 

Usage Description

void Dispose ( )
inline

Releases the lock on application state.

XElement GetTree ( string  path)
inline

Returns the underlying XML node at the specified path. The node returned is a copy of the application state at that path, including the children elements, if any. Use SetTree to update the application state if making modifications to that node.

XElement GetTree ( string  path,
bool  allowCreate 
)
inline

Returns a copy of the element at the specified location. The copy is created if allowCreate is set to true, otherwise will return null.

string GetValue ( string  path)
inline

Returns the value of the element at the specified path in the application state tree.

T GetValueAs< T > ( string  path)
inline

Returns the value of the element at the specified path in the application state tree. The value will be returned in the specified data type. Will throw an InvalidCastException if the value does not exist or cannot be converted.

T GetValueAs< T > ( string  path,
CultureInfo  culture 
)
inline

Returns the value of the element at the specified path in the application state tree. The value will be returned in the specified data type. Will throw an InvalidCastException if the value does not exist or cannot be converted.

T GetValueAs< T > ( string  path,
defaultValue 
)
inline

Returns the value of the element at the specified path in the application state tree. The value will be returned in the specified data type. Will return the specified default if the value does not exist or cannot be converted.

T GetValueAs< T > ( string  path,
defaultValue,
CultureInfo  culture 
)
inline

Returns the value of the element at the specified path in the application state tree. The value will be returned in the specified data type. Will return the specified default if the value does not exist or cannot be converted.

void SetTree ( string  path,
XElement  element 
)
inline

Replaces the application state tree at the specified path with the element provided.

void SetValue ( string  path,
object  value 
)
inline

Sets the value of the element at the specified path in the application state tree.

override string ToString ( )
inline

Returns the entire application state tree, expressed as a string.

string ToString ( SaveOptions  options)
inline

Returns a string that represents the current application state.

Parameters
optionsOptional save options from the .Net framework, such as DisableFormatting or OmitDuplicateNamespaces.

Property Documentation

string this[string path]
getset

Returns the value of the element at the specified path in the application state tree.