11 writes to _directMetadata
Microsoft.Build (11)
Instance\ProjectItemInstance.cs (11)
841_directMetadata = (directMetadata == null || directMetadata.Count == 0) ? null : directMetadata; // If the metadata was all removed, toss the dictionary 1084_directMetadata ??= new CopyOnWritePropertyDictionary<ProjectMetadataInstance>(); 1430destinationAsTaskItem._directMetadata = _directMetadata?.DeepClone(); // copy on write! 1548ref _directMetadata, 1561_directMetadata = null; 1796_directMetadata = new CopyOnWritePropertyDictionary<ProjectMetadataInstance>(); 1801_directMetadata = null; 1843_directMetadata = metadata.DeepClone(); // Copy on write ! 1860_directMetadata ??= new CopyOnWritePropertyDictionary<ProjectMetadataInstance>(); 1882_directMetadata ??= new CopyOnWritePropertyDictionary<ProjectMetadataInstance>(); 1891_directMetadata ??= new CopyOnWritePropertyDictionary<ProjectMetadataInstance>();
28 references to _directMetadata
Microsoft.Build (28)
Instance\ProjectItemInstance.cs (28)
1043get { return (_directMetadata == null) ? 0 : _directMetadata.Count; } 1054var list = _itemDefinitions != null ? MetadataCollection : _directMetadata; 1085_directMetadata.ImportProperties(metadata.Select(kvp => new ProjectMetadataInstance(kvp.Key, kvp.Value, allowItemSpecModifiers: true))); 1142return (_directMetadata == null) ? new CopyOnWritePropertyDictionary<ProjectMetadataInstance>() : _directMetadata.DeepClone(); // copy on write! 1171if (_directMetadata != null) 1173foreach (ProjectMetadataInstance metadatum in (IEnumerable<ProjectMetadataInstance>)_directMetadata) 1323if (_directMetadata != null) 1325string escapedValue = _directMetadata.GetEscapedValue(metadataName); 1384_directMetadata?.Remove(metadataName); 1425if (destinationItem is TaskItem destinationAsTaskItem && destinationAsTaskItem._directMetadata == null) 1430destinationAsTaskItem._directMetadata = _directMetadata?.DeepClone(); // copy on write! 1558if (_directMetadata?.Count == 0) 1628int capacity = _itemDefinitions?.Count ?? 0 + _directMetadata?.Count ?? 0; 1639if (_directMetadata is not null) 1641foreach (ProjectMetadataInstance metadatum in (IEnumerable<ProjectMetadataInstance>)_directMetadata) 1691if ((_directMetadata?.Contains(name) == true) || 1784if (translator.TranslateNullable(_directMetadata)) 1797_directMetadata.ImportProperties(metaData); 1815if (_directMetadata != null) 1817value = _directMetadata[name]; 1841if (_directMetadata == null) 1847_directMetadata.ImportProperties(metadata); 1862_directMetadata.Set(metadatum); 1884_directMetadata.Set(metadatum); 1897_directMetadata.ImportProperties(metadata); 2103return new ProjectItemInstance(_project, ItemType, includeEscaped, includeBeforeWildcardExpansionEscaped, source._taskItem._directMetadata, itemDefinitionsClone, definingProject, useItemDefinitionsWithoutModification: false);