4 writes to _metadata
Microsoft.Build.Utilities.Core (4)
TaskItem.cs (4)
106
_metadata
= new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default);
232
_metadata
= value;
272
_metadata
??= new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default);
490
_metadata
??= new CopyOnWriteDictionary<string>(MSBuildNameIgnoreCaseComparer.Default);
25 references to _metadata
Microsoft.Build.Utilities.Core (25)
TaskItem.cs (25)
114
_metadata
[key] = (string)singleMetadata.Value ?? string.Empty;
197
int count = (
_metadata
?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length;
201
if (
_metadata
is not null)
203
metadataNames.AddRange(
_metadata
.Keys);
216
public int MetadataCount => (
_metadata
?.Count ?? 0) + FileUtilities.ItemSpecModifiers.All.Length;
228
return
_metadata
;
250
_metadata
?.Remove(metadataName);
274
_metadata
[metadataName] = metadataValue ?? string.Empty;
306
if (
_metadata
!= null)
314
copiedMetadata =
_metadata
.Clone(); // Copy on write!
316
else if (destinationAsTaskItem.Metadata.Count <
_metadata
.Count)
318
copiedMetadata =
_metadata
.Clone(); // Copy on write!
324
copiedMetadata.SetItems(
_metadata
.Where(entry => !destinationAsTaskItem.Metadata.TryGetValue(entry.Key, out string val) || String.IsNullOrEmpty(val)));
330
foreach (KeyValuePair<string, string> entry in
_metadata
)
385
if (
_metadata
!= null)
387
foreach (KeyValuePair<string, string> entry in
_metadata
)
447
_metadata
?.TryGetValue(metadataName, out metadataValue);
466
IDictionary ITaskItem2.CloneCustomMetadataEscaped() =>
_metadata
== null
468
:
_metadata
.Clone();
491
_metadata
.SetItems(metadata.Select(kvp => new KeyValuePair<string, string>(kvp.Key, kvp.Value ?? string.Empty)));
496
if (
_metadata
== null)
501
int count =
_metadata
.Count;
504
foreach (var kvp in
_metadata
)
515
if (
_metadata
== null)
520
foreach (var kvp in
_metadata
)