New to Telerik UI for WinFormsStart a free 30-day trial

Represents a collection of all document variables in a RadDocument.

Definition

Namespace:Telerik.WinForms.Documents.Model

Assembly:Telerik.WinControls.RichTextEditor.dll

Syntax:

C#
public class DocumentVariableCollection : IEnumerable

Inheritance: objectDocumentVariableCollection

Implements: IEnumerable

Constructors

Initializes a new instance of the DocumentVariableCollection class.

C#
public DocumentVariableCollection(RadDocument owner, DocumentVariableCollection toCopyFrom)
Parameters:ownerRadDocument

The associated document.

toCopyFromDocumentVariableCollection

A collection of document variables which will be added to the associated document.

Initializes a new instance of the DocumentVariableCollection class.

C#
public DocumentVariableCollection(RadDocument owner)
Parameters:ownerRadDocument

The associated document.

Properties

Gets the number of elements contained in the ICollection<T>.

C#
public int Count { get; }

Gets a value indicating whether the ICollection<T> is read-only.

C#
public bool IsReadOnly { get; }

Keys

ICollection<string>

Gets an ICollection<T> containing the keys of the IDictionary<TKey, TValue>.

C#
public ICollection<string> Keys { get; }

Gets or sets the variable with the specified key.

C#
public object this[string key] { get; set; }
Parameters:keystring

The key of the variable.

Property Value:

The document variable.

Values

ICollection<object>

Gets an ICollection<T> containing the values in the IDictionary<TKey, TValue>.

C#
public ICollection<object> Values { get; }

Methods

Adds an element with the provided key and value to the IDictionary<TKey, TValue>.

C#
public void Add(string key, object value)
Parameters:keystring

The object to use as the key of the element to add.

valueobject

The object to use as the value of the element to add.

Removes all items from the ICollection<T>.

C#
public void Clear()

Determines whether the IDictionary<TKey, TValue> contains an element with the specified key.

C#
public bool ContainsKey(string key)
Parameters:keystring

The key to locate in the IDictionary<TKey, TValue>.

Returns:

bool

true if the IDictionary<TKey, TValue> contains an element with the key; otherwise, false.

Evaluates the variable value.

C#
public object EvaluateVariableValue(string variableName)
Parameters:variableNamestring

Name of the variable.

Returns:

object

The value of the variable.

Returns an enumerator that iterates through the collection.

C#
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
Returns:

IEnumerator<KeyValuePair<string, object>>

An enumerator that can be used to iterate through the collection.

Removes the element with the specified key from the IDictionary<TKey, TValue>.

C#
public bool Remove(string key)
Parameters:keystring

The key of the element to remove.

Returns:

bool

true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original IDictionary<TKey, TValue>.

Gets the value associated with the specified key.

C#
public bool TryGetValue(string key, out object value)
Parameters:keystring

The key whose value to get.

valueobject

When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

Returns:

bool

true if the object that implements IDictionary<TKey, TValue> contains an element with the specified key; otherwise, false.