• Share
    • Twitter
    • LinkedIn
    • Facebook
    • Email
  • Feedback
  • Improve this Doc

Class StateVariable<T>

Wrapper class for any object that maps string key onto the object value (like ).

Inheritance
System.Object
StateVariable<T>
SessionVariable<T>
Namespace: DotNetNuke.Common.Utilities
Assembly: DotNetNuke.dll
Syntax
public abstract class StateVariable<T> : object
Type Parameters
Name Description
T

The type of the variable's value.

Constructors

| Improve this Doc View Source

StateVariable(String, Func<T>)

Initializes a new instance of the StateVariable<T> class. Initializes a new item variable with a initializer.

Declaration
protected StateVariable(string key, Func<T> initializer)
Parameters
Type Name Description
System.String key

The key to use for storing the value in the dictionary.

Func<T> initializer

A function that is called in order to create a default value per dictionary.

| Improve this Doc View Source

StateVariable(String)

Initializes a new instance of the StateVariable<T> class. Initializes a new item variable.

Declaration
protected StateVariable(string key)
Parameters
Type Name Description
System.String key

The key to use for storing the value in the items.

Properties

| Improve this Doc View Source

HasValue

Gets a value indicating whether indicates wether there is a value present or not.

Declaration
public bool HasValue { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

Item[String]

Get/sets the value in associated dictionary/map.

Declaration
protected abstract object this[string key] { get; set; }
Parameters
Type Name Description
System.String key

Value key.

Property Value
Type Description
System.Object

The value.

| Improve this Doc View Source

Value

Gets or sets or gets the value in the current items.

Declaration
public T Value { get; set; }
Property Value
Type Description
T
| Improve this Doc View Source

ValueOrDefault

Gets the value in the current items or if none is available default(T).

Declaration
public T ValueOrDefault { get; }
Property Value
Type Description
T

Methods

| Improve this Doc View Source

Clear()

Clears the value in the current items.

Declaration
public void Clear()
| Improve this Doc View Source

Remove(String)

Removes the value in associated dictionary according.

Declaration
protected abstract void Remove(string key)
Parameters
Type Name Description
System.String key

Value key.

Extension Methods

JsonExtensionsWeb.ToJson(Object)
  • View Source
Back to top by the community, for the community... #DNNCMS