In Memory Target Dictionary Class
This contains a collection of targets indexed by member ID stored in a simple
ConcurrentDictionaryTKey, TValue entirely in memory.
Definition
Namespace: Sandcastle.Tools.BuildComponents.Targets
Assembly: Sandcastle.Tools.BuildComponents (in Sandcastle.Tools.BuildComponents.dll) Version: 2026.1.20.0
Assembly: Sandcastle.Tools.BuildComponents (in Sandcastle.Tools.BuildComponents.dll) Version: 2026.1.20.0
C#
[SerializableAttribute]
public sealed class InMemoryTargetDictionary : TargetDictionaryVB
<SerializableAttribute>
Public NotInheritable Class InMemoryTargetDictionary
Inherits TargetDictionaryC++
[SerializableAttribute]
public ref class InMemoryTargetDictionary sealed : public TargetDictionaryF#
[<SealedAttribute>]
[<SerializableAttribute>]
type InMemoryTargetDictionary =
class
inherit TargetDictionary
end- Inheritance
- Object TargetDictionary InMemoryTargetDictionary
Remarks
The behavior of this dictionary is to return null if a target ID is not found and to replace
existing entries if a duplicate ID is added. All targets are stored in memory. Since it must load all
targets the first time the files are encountered, it can slow down initialization. The trade off is that
it can run faster than database-backed implementations that look up the items rather than storing them
in memory.
This implementation does not offer the option for a persistent cache as streaming the entire dictionary in and out takes several times longer than just loading the source XML data.
Constructors
| InMemoryTargetDictionary | Constructor |
Properties
| BuildComponent |
This read-only property returns the build component that owns the target dictionary
(Inherited from TargetDictionary) |
| Count | Gets the number of elements contained in the ICollectionT. (Overrides TargetDictionaryCount) |
| DictionaryId |
This is used to get or set the target dictionary's unique ID
(Inherited from TargetDictionary) |
| DirectoryPath |
This is used to get or set the path to the target files
(Inherited from TargetDictionary) |
| FilePattern |
This is used to get or set the file pattern to use when searching for target files
(Inherited from TargetDictionary) |
| IsDisposed |
This read-only property can be used to determine whether or not the target dictionary has been
disposed.
(Inherited from TargetDictionary) |
| IsReadOnly | Gets a value indicating whether the ICollectionT is read-only. (Inherited from TargetDictionary) |
| Item | Gets or sets the element with the specified key. (Overrides TargetDictionaryItemString) |
| Keys | Gets an ICollectionT containing the keys of the IDictionaryTKey, TValue. (Overrides TargetDictionaryKeys) |
| NamespaceFileFilter |
This read-only property returns any optional namespace files used to filter what gets loaded
(Inherited from TargetDictionary) |
| Recurse |
This is used to get or set whether to recurse into subfolders of DirectoryPath when
loading target files.
(Inherited from TargetDictionary) |
| Values | Gets an ICollectionT containing the values in the IDictionaryTKey, TValue. (Overrides TargetDictionaryValues) |
Methods
| Add(KeyValuePairString, Target) | Adds an item to the ICollectionT. (Overrides TargetDictionaryAdd(KeyValuePairString, Target)) |
| Add(String, Target) | Adds an element with the provided key and value to the IDictionaryTKey, TValue. (Overrides TargetDictionaryAdd(String, Target)) |
| Clear | Removes all items from the ICollectionT. (Overrides TargetDictionaryClear) |
| Contains | Determines whether the ICollectionT contains a specific value. (Overrides TargetDictionaryContains(KeyValuePairString, Target)) |
| ContainsKey | Determines whether the IDictionaryTKey, TValue contains an element with the specified key. (Overrides TargetDictionaryContainsKey(String)) |
| CopyTo | Copies the elements of the ICollectionT to an Array, starting at a particular Array index. (Overrides TargetDictionaryCopyTo(KeyValuePairString, Target, Int32)) |
| Dispose |
This implements the Dispose() interface to properly dispose of the target dictionary
(Inherited from TargetDictionary) |
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) |
| GetEnumerator | Returns an enumerator that iterates through the collection. (Overrides TargetDictionaryGetEnumerator) |
| GetHashCode | Serves as the default hash function. (Inherited from Object) |
| GetType | Gets the Type of the current instance. (Inherited from Object) |
| Remove(KeyValuePairString, Target) | Removes the first occurrence of a specific object from the ICollectionT. (Inherited from TargetDictionary) |
| Remove(String) | Removes the element with the specified key from the IDictionaryTKey, TValue. (Inherited from TargetDictionary) |
| ReportCacheStatistics |
This can be overridden in derived classes to report cache usage statistics after the build
(Inherited from TargetDictionary) |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| TryGetValue | Gets the value associated with the specified key. (Overrides TargetDictionaryTryGetValue(String, Target)) |