XmlBinaryWriterSession.TryAdd Method (XmlDictionaryString, Int32)

 

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 if the string could be added; otherwise, false.

Exception Condition
ArgumentNullException

value is null.

InvalidOperationException

An entry with key = key already exists.

When you use this class you must override this method to send the collection of keys along with the message. Without overriding, a new key is added to the collection, which is saved, but not sent with the message.

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.0
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show: