Class VariableCollection
A key-value collection of document variables (string name → string value).
Maps to the OOXML w:docVars/w:docVar elements in
settings.xml. Variables are used by fields and macros.
Implements
Inherited Members
Namespace: DRIT.Document
Assembly: DRIT.Document.dll
Syntax
public class VariableCollection : IDictionary<string, string>, ICollection<KeyValuePair<string, string>>, IEnumerable<KeyValuePair<string, string>>, IEnumerable
Properties
Count
Gets or sets count.
Declaration
public int Count { get; }
Property Value
| Type | Description |
|---|---|
| int |
IsReadOnly
Gets or sets is read only.
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| bool |
this[string]
Gets this[string].
Declaration
public string this[string key] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | key |
Property Value
| Type | Description |
|---|---|
| string |
Keys
Gets or sets keys.
Declaration
public ICollection<string> Keys { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<string> |
Values
Gets or sets values.
Declaration
public ICollection<string> Values { get; }
Property Value
| Type | Description |
|---|---|
| ICollection<string> |
Methods
Add(KeyValuePair<string, string>)
Adds the specified item to this collection.
Declaration
public void Add(KeyValuePair<string, string> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<string, string> | item | The item to use for the operation. |
Add(string, string)
Adds the specified item to this collection.
Declaration
public void Add(string key, string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key used by the operation. |
| string | value | The value to use for the operation. |
Clear()
Provides the clear behavior for this object.
Declaration
public void Clear()
Contains(KeyValuePair<string, string>)
Provides the contains behavior for this object.
Declaration
public bool Contains(KeyValuePair<string, string> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<string, string> | item | The item to use for the operation. |
Returns
| Type | Description |
|---|---|
| bool | The resulting value. |
ContainsKey(string)
Provides the contains Key behavior for this object.
Declaration
public bool ContainsKey(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key used by the operation. |
Returns
| Type | Description |
|---|---|
| bool | The resulting value. |
CopyTo(KeyValuePair<string, string>[], int)
Provides the copy To behavior for this object.
Declaration
public void CopyTo(KeyValuePair<string, string>[] array, int arrayIndex)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<string, string>[] | array | The array used by the operation. |
| int | arrayIndex | The array Index used by the operation. |
GetEnumerator()
Describes the variable Collection configuration.
Declaration
public IEnumerator<KeyValuePair<string, string>> GetEnumerator()
Returns
| Type | Description |
|---|---|
| IEnumerator<KeyValuePair<string, string>> | The resulting value. |
Remove(KeyValuePair<string, string>)
Removes an item from this collection.
Declaration
public bool Remove(KeyValuePair<string, string> item)
Parameters
| Type | Name | Description |
|---|---|---|
| KeyValuePair<string, string> | item | The item to use for the operation. |
Returns
| Type | Description |
|---|---|
| bool | The resulting value. |
Remove(string)
Removes an item from this collection.
Declaration
public bool Remove(string key)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key used by the operation. |
Returns
| Type | Description |
|---|---|
| bool | The resulting value. |
TryGetValue(string, out string)
Attempts to get Value and reports whether the operation succeeded.
Declaration
public bool TryGetValue(string key, out string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | key | The key used by the operation. |
| string | value | The value to use for the operation. |
Returns
| Type | Description |
|---|---|
| bool | The resulting value. |