Click or drag to resize

NamedObjectDictionary Class

Represents a dictionary of named code or metadata objects (INamedCodeObjects and/or IMemberDefinitions/MemberInfos), allowing multiple entries with the same name. Differs from NamedCodeObjectDictionary in that it can hold metadata (IMemberDefinition/MemberInfo) in addition to INamedCodeObjects.
Inheritance Hierarchy
SystemObject
  Nova.CodeDOMNamedObjectDictionary

Namespace:  Nova.CodeDOM
Assembly:  Nova.CodeDOM (in Nova.CodeDOM.dll) Version: 7.44.8391.13415
Syntax
C#
public class NamedObjectDictionary : ICollection, 
	IEnumerable

The NamedObjectDictionary type exposes the following members.

Constructors
  NameDescription
Public methodNamedObjectDictionary
Initializes a new instance of the NamedObjectDictionary class
Top
Properties
  NameDescription
Public propertyCount
The number of items in the dictionary.
Public propertyIsSynchronized
True if access to the ICollection is synchronized.
Public propertySyncRoot
Gets an object that can be used to synchronize access to the ICollection.
Top
Methods
  NameDescription
Public methodAdd
Add a code object or metadata object (INamedCodeObject or IMemberDefinition/MemberInfo) with the specified name to the dictionary.
Public methodClear
Clear all members from the dictionary.
Public methodCopyTo
Copy the objects in the dictionary to the specified array, starting at the specified offset.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodFind
Find named code object(s) in the dictionary by name.
Public methodGetEnumerator
Get an enumerator for the objects in the dictionary.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemove
Remove the object with the specified name from the dictionary.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Fields
  NameDescription
Protected field_dictionary
Top
Extension Methods
  NameDescription
Public Extension MethodIsEmpty
Check if the specified collection is empty or null.
(Defined by CollectionUtil.)
Public Extension MethodNNCount
Get the count of the specified collection, or 0 if it's null.
(Defined by CollectionUtil.)
Public Extension MethodNotEmpty
Check if the specified collection is empty or null.
(Defined by CollectionUtil.)
Public Extension MethodToString
Format the specified collection into a single string using the specified separating string to separate each item. Null items are converted to empty strings.
(Defined by StringUtil.)
Top
Remarks
This dictionary is used to maintain a dictionary of child INamedCodeObjects and/or IMemberDefinitions/MemberInfos to allow for lookups by name. It handles multiple entries with the same name (such as overloaded methods, different type parameter counts, or name collisions in invalid code) by storing a NamedObjectGroup object. One use of this class is for caching extension method lookups on Namespaces. The related NamedObjectGroup class is also used in many cases when working with collections of named objects that can be metadata (IMemberDefinition/MemberInfo) in addition to INamedCodeObjects.
See Also