1 write to Key
System.Configuration.ConfigurationManager (1)
System\Configuration\ConfigurationElementCollection.cs (1)
1281_current.Key = entry.GetKey(_thisCollection) ?? "key";
185 references to Key
Aspire.Hosting (1)
Dcp\DcpHost.cs (1)
206var key = de.Key?.ToString();
dotnet-svcutil-lib (12)
FrameworkFork\Microsoft.Xml\Xml\schema\ContentValidator.cs (3)
227return ((XmlQualifiedName)de.Key).ToString(); 236return (string)de.Key + ":*"; 2340names.Add(entry.Key);
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaCollectionPreprocessor.cs (3)
708redefine.Schema.Groups.Insert((XmlQualifiedName)entry.Key, (XmlSchemaObject)entry.Value); 712redefine.Schema.AttributeGroups.Insert((XmlQualifiedName)entry.Key, (XmlSchemaObject)entry.Value); 716redefine.Schema.SchemaTypes.Insert((XmlQualifiedName)entry.Key, (XmlSchemaObject)entry.Value);
FrameworkFork\Microsoft.Xml\Xml\schema\SchemaNamespaceManager.cs (1)
56return (string)entry.Key;
FrameworkFork\Microsoft.Xml\Xml\schema\XmlSchemaSet.cs (1)
1013if (schemaUri.Equals(locationsTable[i].Key))
FrameworkFork\Microsoft.Xml\Xml\Serialization\Types.cs (1)
778return de.Key as Type;
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationReader.cs (1)
1600UnreferencedObject((string)target.Key, target.Value);
FrameworkFork\Microsoft.Xml\Xml\Serialization\XmlSerializationWriter.cs (1)
1476string prefix = (string)entry.Key;
FrameworkFork\System.ServiceModel\System\ServiceModel\Description\DataContractSerializerOperationGenerator.cs (1)
140targetCompileUnit.UserData[userData.Key] = userData.Value;
Microsoft.AspNetCore.Grpc.JsonTranscoding (3)
Internal\Json\JsonConverterHelper.cs (1)
144existingValue[item.Key] = item.Value;
Internal\Json\StructConverter.cs (1)
33var k = (string)entry.Key;
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (1)
259map[value.Key] = value.Value;
Microsoft.AspNetCore.Grpc.Swagger (1)
src\Grpc\JsonTranscoding\src\Shared\ServiceDescriptorHelpers.cs (1)
259map[value.Key] = value.Value;
Microsoft.Build (20)
BackEnd\Client\MSBuildClient.cs (1)
507envVars[(string)envVar.Key] = (envVar.Value as string) ?? string.Empty;
BackEnd\Components\RequestBuilder\IntrinsicTasks\ItemGroupLoggingHelper.cs (1)
221keyValuePairList.Add(new KeyValuePair<string, string>((string)kvp.Key, (string)kvp.Value));
BackEnd\Components\RequestBuilder\TaskHost.cs (1)
1190propertyDictionaries[i].Set(ProjectPropertyInstance.Create(entry.Key as string, entry.Value as string, _taskLocation));
BackEnd\TaskExecutionHost\TaskExecutionHost.cs (1)
1421yield return new KeyValuePair<string, string>((string)de.Key, EscapingUtilities.Escape((string)de.Value));
Evaluation\Expander.cs (1)
1494builder.Append(EscapingUtilities.Escape(ConvertToString(entry.Key)));
Instance\ProjectInstance.cs (2)
2954string environmentVariableName = environmentVariable.Key as string; 2979Environment.SetEnvironmentVariable(clearedVariable.Key as string, clearedVariable.Value as string);
Logging\BaseConsoleLogger.cs (5)
98return string.Compare((string)a.Key, (string)b.Key, StringComparison.CurrentCultureIgnoreCase); 539WritePretty(String.Format(CultureInfo.CurrentCulture, "{0,-30} = ", prop.Key)); 566string itemType = (string)entry.Key; 597string key = (string)item.Key;
Logging\BinaryLogger\BuildEventArgsWriter.cs (1)
974string key = (string)dictionaryEntry.Key;
Logging\ParallelLogger\ParallelConsoleLogger.cs (4)
600if (string.Equals((string)item.Key, ItemMetadataNames.ProjectConfigurationDescription, StringComparison.OrdinalIgnoreCase)) 763string propertyString = String.Format(CultureInfo.CurrentCulture, "{0} = {1}", prop.Key, EscapingUtilities.UnescapeAll((string)(prop.Value))); 900WriteMessageAligned(new String(' ', 4 * tabWidth) + metadatum.Key + " = " + item.GetMetadata(metadatum.Key as string), false);
LogMessagePacketBase.cs (1)
1143list.Add((dictionaryEntry.Key as string, dictionaryEntry.Value));
Utilities\Utilities.cs (2)
660else if (item is DictionaryEntry dictionaryEntry && dictionaryEntry.Key is string key && !string.IsNullOrEmpty(key)) 827itemType = dictionaryEntry.Key as string;
Microsoft.Build.CommandLine.UnitTests (3)
CommandLineSwitches_Tests.cs (3)
1547.Cast<DictionaryEntry>().Where(i => i.Key is string && ((string)i.Key).StartsWith("HelpMessage_")) 1548.Select(i => new KeyValuePair<string, string>((string)i.Key, (string)i.Value)))
Microsoft.Build.Engine.UnitTests (8)
BackEnd\TranslationHelpers.cs (2)
174(Func<DictionaryEntry, string>)(d => d.Key.ToString()), 183.Select(i => i.Key.ToString() + GetTaskItemString(i.Value));
CommunicationUtilities_Tests.cs (1)
28referenceVars2.Add((string)item.Key!, (string)item.Value!);
ConsoleLogger_Tests.cs (1)
131_environment.Add((string)entry.Key, (string)entry.Value);
Evaluation\ExpressionShredder_Tests.cs (4)
531if (expected?.Contains(result.Key) != true) 533messages.Add("Found <" + result.Key + "> in <" + test + "> but it wasn't expected"); 542if (actual?.Contains(expect.Key) != true) 544messages.Add("Did not find <" + expect.Key + "> in <" + test + ">");
Microsoft.Build.Framework (2)
ProjectStartedEventArgs.cs (2)
386var validProperties = properties.Cast<DictionaryEntry>().Where(entry => entry.Key != null && entry.Value != null); 397writer.Write((string)propertyPair.Key);
Microsoft.Build.Framework.UnitTests (3)
CustomEventArgSerialization_Tests.cs (3)
634string key = (string)entry.Key; 636if (key.Equals((string)property.Key, StringComparison.OrdinalIgnoreCase)) 645found.ShouldBeTrue($"Expected to find Key: {property.Key} Value: {property.Value}");
Microsoft.Build.Tasks.Core (3)
ManifestUtil\XmlUtil.cs (1)
110string key = entry.Key.ToString();
WriteCodeFragment.cs (2)
201string name = (string)entry.Key; 304string key = (string)entry.Key;
Microsoft.Build.Tasks.UnitTests (1)
ResolveNonMSBuildProjectOutput_Tests.cs (1)
93xmlString += string.Format("<ProjectRef Project=\"{0}\">{1}</ProjectRef>", entry.Key, entry.Value);
Microsoft.Build.UnitTests.Shared (2)
MockEngine.cs (2)
243finalGlobalProperties[(string)newGlobalProperty.Key] = (string)newGlobalProperty.Value; 310finalGlobalProperties[(string)newGlobalProperty.Key] = (string)newGlobalProperty.Value;
Microsoft.Build.Utilities.Core (1)
TaskItem.cs (1)
128string key = (string)singleMetadata.Key;
Microsoft.CodeAnalysis.Scripting (1)
Hosting\ObjectFormatter\CommonObjectFormatter.Visitor.cs (1)
596FormatObjectRecursive(result, entry.Key, isRoot: false, debuggerDisplayName: out _);
Microsoft.CodeAnalysis.UnitTests (4)
Collections\ImmutableDictionaryBuilderTestBase.cs (2)
205Assert.Equal(enumerator.Key, enumerator.Entry.Key); 222Assert.Equal(enumerator.Key, ((DictionaryEntry)enumerator.Current).Key);
Collections\ImmutableDictionaryTestBase.cs (2)
193Assert.Equal(enumerator.Key, enumerator.Entry.Key); 210Assert.Equal(enumerator.Key, ((DictionaryEntry)enumerator.Current).Key);
Microsoft.DotNet.ArcadeLogging (1)
PipelinesLogger.cs (1)
245string propertyCategory = e.Properties?.Cast<DictionaryEntry>().LastOrDefault(p => p.Key.ToString().Equals(s_TelemetryMarker)).Value?.ToString();
Microsoft.Extensions.Configuration.EnvironmentVariables (1)
EnvironmentVariablesConfigurationProvider.cs (1)
71string key = (string)e.Entry.Key;
Microsoft.Extensions.Localization (1)
Internal\ResourceManagerStringProvider.cs (1)
79if (entry?.Key is string key)
Microsoft.ML.CodeGenerator (1)
Utils.cs (1)
82return sampleData.Cast<DictionaryEntry>().ToDictionary(k => (string)k.Key, v => (string)v.Value);
Microsoft.ML.Maml (4)
MAML.cs (4)
278if (Contracts.IsMarkedKey.Equals(kvp.Key)) 280if (Contracts.SensitivityKey.Equals(kvp.Key)) 288if (ConsoleEnvironment.ComponentHistoryKey.Equals(kvp.Key)) 304writer.WriteLine(" {0}: {1}", kvp.Key, kvp.Value);
Microsoft.VisualBasic.Core (1)
Microsoft\VisualBasic\FileIO\FileSystem.vb (1)
997IOException.Data.Add(Entry.Key, Entry.Value)
PresentationBuildTasks (1)
src\Microsoft.DotNet.Wpf\src\PresentationFramework\System\Windows\Markup\XamlTypeMapper.cs (1)
372ReflectionHelper.LoadAssembly(entry.Key as String, entry.Value as String);
PresentationCore (7)
System\Windows\Input\AccessKeyManager.cs (2)
684return (string)entry.Key; 717return (string)entry.Key;
System\Windows\Media\Animation\Clock.cs (2)
4378removeTable[e.Key] = weakRef; 4385_objectTable.Remove(e.Key);
System\Windows\Media\Animation\Timeline.cs (2)
1165removeTable[e.Key] = weakRef; 1172_objectTable.Remove(e.Key);
System\Windows\Media\Imaging\ImagingCache.cs (1)
79al.Add(de.Key);
PresentationFramework (17)
MS\Internal\Data\StaticPropertyChangedEventManager.cs (1)
400Debug.Assert((String)de.Key != AllListenersKey, "special key should not appear");
MS\Internal\Data\ValueTable.cs (1)
248ValueTableKey key = (ValueTableKey)de.Key;
MS\Internal\Data\ViewManager.cs (2)
250WeakRefKey key = (WeakRefKey)de.Key; 793WeakRefKey key = (WeakRefKey)de.Key;
System\Windows\Controls\Grid.cs (1)
1251SpanKey key = (SpanKey)e.Key;
System\Windows\Markup\Localizer\BamlLocalizationDictionary.cs (1)
54get => (BamlLocalizableResourceKey)Entry.Key;
System\Windows\Markup\Primitives\ElementMarkupObject.cs (4)
506return String.Compare(one.Key.ToString(), two.Key.ToString()); 514subItem.SetKey(new ElementKey(entry.Key, keyType, subItem)); 1168item.SetKey(new ElementKey(entry.Key, typeof(object), item));
System\Windows\Markup\XamlTypeMapper.cs (2)
302newDict.Add(de.Key, de.Value); 372ReflectionHelper.LoadAssembly(entry.Key as String, entry.Value as String);
System\Windows\Markup\XamlTypeMapperSchemaContext.cs (2)
61_piNamespaces.Add((string)entry.Key, clrNs); 150XmlNamespace = (string)piEntry.Key,
System\Windows\Media\Animation\Storyboard.cs (1)
612ObjectPropertyPair key = (ObjectPropertyPair)entry.Key;
System\Windows\ResourceDictionary.cs (1)
98OnGettingValuePrivate(entry.Key, ref value, out canCache);
System\Windows\StyleHelper.cs (1)
2299DependencyProperty dp = (DependencyProperty)entry.Key;
ReachFramework (1)
Serialization\VisualTreeFlattener.cs (1)
776string key = e.Key as string;
System.Collections.Specialized (10)
System\Collections\Specialized\OrderedDictionary.cs (10)
170object key = ((DictionaryEntry)objectsArray[index]!).Key; 288object o = ((DictionaryEntry)_objectsArray[i]!).Key; 337object key = ((DictionaryEntry)objectsArray[index]!).Key; 434objectsTable.Add(entry.Key, entry.Value); 468return ((DictionaryEntry)_arrayEnumerator.Current).Key; 486return new DictionaryEntry(((DictionaryEntry)_arrayEnumerator.Current).Key, ((DictionaryEntry)_arrayEnumerator.Current).Value); 498return ((DictionaryEntry)_arrayEnumerator.Current).Key; 564array.SetValue(IsKeys ? ((DictionaryEntry)o).Key : ((DictionaryEntry)o).Value, index); 606object entryKey = ((DictionaryEntry)_objects[i]!).Key; 636return IsKeys ? entry.Key : entry.Value;
System.ComponentModel.TypeConverter (6)
System\ComponentModel\ComponentResourceManager.cs (1)
254sd[(string)de.Key] = de.Value;
System\ComponentModel\Design\DesigntimeLicenseContextSerializer.cs (1)
47writer.Write(keyAndValue.Key.ToString()!);
System\ComponentModel\ReflectTypeDescriptionProvider.cs (1)
1485Type? keyType = de.Key as Type;
System\ComponentModel\TypeDescriptor.cs (3)
2333Type? nodeType = de.Key as Type; 2417Type? nodeType = de.Key as Type; 2478Type? nodeType = de.Key as Type;
System.Configuration.ConfigurationManager (9)
System\Configuration\ClientSettingsStore.cs (2)
187SettingElement se = sec.Get((string)entry.Key); 192se.Name = (string)entry.Key;
System\Configuration\ConfigurationElementCollection.cs (1)
1297object IDictionaryEnumerator.Key => _current.Key;
System\Configuration\ConfigurationLockCollection.cs (2)
73sb.Append(de.Key); 283removeList.Add(de.Key);
System\Configuration\MgmtConfigurationRecord.cs (1)
1538string configKey = (string)de.Key;
System\Configuration\SectionUpdates.cs (2)
212string group = (string)de.Key; 233string group = (string)de.Key;
System\Configuration\SettingsPropertyValueCollection.cs (1)
60al.Add(de.Key);
System.Data.Common (4)
System\Data\PropertyCollection.cs (1)
35clone.Add(pair.Key, pair.Value);
System\Data\xmlsaver.cs (3)
74if (entry.Key is INullable) 76s = (string)SqlConvert.ChangeTypeForXML(entry.Key, typeof(string)); 80s = Convert.ToString(entry.Key, CultureInfo.InvariantCulture)!;
System.Diagnostics.Process (1)
System\Diagnostics\ProcessStartInfo.cs (1)
109_environmentVariables.Add((string)entry.Key, (string?)entry.Value);
System.Net.Primitives (1)
System\Net\CookieContainer.cs (1)
391tempDomain = (string)entry.Key;
System.Net.Requests (1)
System\Net\TimerThread.cs (1)
143garbage.Add(pair.Key);
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\Collections\DictionaryEntry.cs (1)
42key = Key;
System.Private.DataContractSerialization (1)
System\Runtime\Serialization\Json\XmlObjectSerializerWriteContextComplexJson.cs (1)
227genericDictionaryObj.Add(entry.Key, entry.Value);
System.Private.Xml (6)
System\Xml\Schema\SchemaCollectionpreProcessor.cs (3)
698redefine.Schema!.Groups.Insert((XmlQualifiedName)entry.Key!, (XmlSchemaObject)entry.Value!); 703redefine.Schema!.AttributeGroups.Insert((XmlQualifiedName)entry.Key!, (XmlSchemaObject)entry.Value!); 708redefine.Schema!.SchemaTypes.Insert((XmlQualifiedName)entry.Key!, (XmlSchemaObject)entry.Value!);
System\Xml\Schema\XmlSchemaSet.cs (1)
859if (schemaUri.Equals(locationsTable[i].Key))
System\Xml\Serialization\Types.cs (1)
748return de.Key as Type;
System\Xml\Serialization\XmlSerializationReader.cs (1)
1499UnreferencedObject((string)target.Key, target.Value!);
System.Runtime.Caching (1)
System\Runtime\Caching\MemoryCacheStore.cs (1)
233MemoryCacheKey key = e.Key as MemoryCacheKey;
System.Text.RegularExpressions.Generator (4)
RegexGenerator.Emitter.cs (4)
156AppendHashtableContents(writer, rm.Tree.CaptureNumberSparseMapping.Cast<DictionaryEntry>().OrderBy(de => de.Key as int?)); 162AppendHashtableContents(writer, rm.Tree.CaptureNameToNumberMapping.Cast<DictionaryEntry>().OrderBy(de => de.Key as string, StringComparer.Ordinal)); 191if (en.Key is int key) 197writer.Write($"\"{en.Key}\"");
System.Windows.Forms (2)
System\Windows\Forms\Layout\DefaultLayout.cs (2)
1049IArrangedElement element = (IArrangedElement)entry.Key; 1056dictionary.Remove(entry.Key);
System.Windows.Forms.Design (7)
System\ComponentModel\Design\Serialization\StatementContext.cs (1)
232public readonly object Key => Entry.Key;
System\Drawing\Design\ToolboxItem.cs (2)
712propertyNames.Add((string)de.Key); 713info.AddValue((string)de.Key, de.Value);
System\Resources\Tools\StronglyTypedResourceBuilder.cs (3)
171string keyname = (string)entry.Key; 190resourceTypes.Add((string)entry.Key, data); 281resourceList.Add((string)entry.Key, data);
System\Windows\Forms\Design\SplitterPanelDesigner.cs (1)
233properties[de.Key] = TypeDescriptor.CreateProperty(descriptor.ComponentType, descriptor, BrowsableAttribute.No, DesignerSerializationVisibilityAttribute.Hidden);
System.Windows.Forms.Tests (22)
misc\CollectionHelperTests.cs (4)
103Assert.Equal("key-one", (string)firstTargetItem.Key); 108Assert.Equal("key-two", (string)secondTargetItem.Key); 125Assert.Equal("key-one", (string)firstTargetItem.Key); 129Assert.Equal("key-two", (string)secondTargetItem.Key);
System\Resources\ResXResourceWriterTests.cs (7)
139Assert.Equal(_testString1, currentEntry.Key); 160Assert.Equal(_testString1, currentEntry.Key); 181Assert.Equal(_testString1, currentEntry.Key); 202Assert.Equal(_testString1, currentEntry.Key); 223Assert.Equal(_testString1, currentEntry.Key); 244Assert.Equal(_testString1, currentEntry.Key); 266Assert.Equal(_testString1, currentEntry.Key);
System\Windows\Forms\BindingContextTests.cs (11)
173Assert.NotNull(Assert.IsType<DictionaryEntry>(array[1]).Key); 784Assert.True(entry1.Key.Equals(entry1.Key)); 785Assert.True(entry1.Key.Equals(entry2.Key)); 786Assert.False(entry1.Key.Equals(entry3.Key)); 787Assert.False(entry1.Key.Equals(entry4.Key)); 789Assert.False(entry1.Key.Equals(new object())); 790Assert.False(entry1.Key.Equals(null));
System.Xaml (8)
System\Xaml\NameScope.cs (1)
123array[arrayIndex++] = new KeyValuePair<string, object>((string)entry.Key, entry.Value);
System\Xaml\XamlObjectReader.cs (7)
441if (entry.Key is not null) 443actualKeyType = context.GetXamlType(entry.Key.GetType()); 446if (entry.Key is not null && actualKeyType != keyType) 449keyValue = ObjectMarkupInfo.ForObject(entry.Key, context, tc); 455keyValue = GetPropertyValueInfoInternal(entry.Key, vs, tc, false, null, context); 488return entry.Key is null; 490else if (dkpObject.Equals(entry.Key))
XmlFileLogger (1)
PropertyBag.cs (1)
89AddProperty(property.Key.ToString(), property.Value.ToString());