TryAdd Method
Collapse the table of content
Expand the table of content

XmlBinaryWriterSession.TryAdd Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Tries to add an XmlDictionaryString to the internal collection.

Namespace:  System.Xml
Assembly:  System.Runtime.Serialization (in System.Runtime.Serialization.dll)

public virtual bool TryAdd(
	XmlDictionaryString value,
	out int key
)

Parameters

value
Type: System.Xml.XmlDictionaryString
The XmlDictionaryString to add.
key
Type: System.Int32 %
The key of the XmlDictionaryString that was successfully added.

Return Value

Type: System.Boolean
true, unless an exception was thrown.

ExceptionCondition
ArgumentNullException

value is null.

InvalidOperationException

An entry with key = key already exists.

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft