/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (disposed) { return; } GC.SuppressFinalize(this); disposed = true; definitions.Clear(); definitions = null; directoryKeys.Clear(); directoryKeys = null; fileKeys.Clear(); fileKeys = null; typeAndIdKeys.Clear(); typeAndIdKeys = null; typeKeys.Clear(); typeKeys = null; allFileKeys.Clear(); allFileKeys = null; childHierarchicalDefinitions.Clear(); childHierarchicalDefinitions = null; mainHierarchalDefinitions.Clear(); mainHierarchalDefinitions = null; trie = null; resetDefinitions.Clear(); resetDefinitions = null; }
/// <summary> /// Initializes a new instance of the <see cref="IndexedDefinitions" /> class. /// </summary> public IndexedDefinitions() { definitions = new ConcurrentIndexedList <IDefinition>(nameof(IDefinition.FileCI), nameof(IDefinition.Type), nameof(IDefinition.TypeAndId), nameof(IDefinition.ParentDirectoryCI), nameof(IDefinition.ValueType), nameof(IDefinition.DiskFileCI)); fileKeys = new HashSet <string>(); typeAndIdKeys = new HashSet <string>(); typeKeys = new HashSet <string>(); allFileKeys = new HashSet <string>(); childHierarchicalDefinitions = new ConcurrentDictionary <string, ConcurrentIndexedList <IHierarchicalDefinitions> >(); mainHierarchalDefinitions = new ConcurrentIndexedList <IHierarchicalDefinitions>(nameof(IHierarchicalDefinitions.Name)); }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (disposed) { return; } disposed = true; definitions.Clear(); definitions = null; fileKeys.Clear(); fileKeys = null; typeAndIdKeys.Clear(); typeAndIdKeys = null; typeKeys.Clear(); typeKeys = null; allFileKeys.Clear(); allFileKeys = null; childHierarchicalDefinitions.Clear(); childHierarchicalDefinitions = null; mainHierarchalDefinitions.Clear(); mainHierarchalDefinitions = null; trie = null; }