WriteChars() public method

public WriteChars ( Char buffer, int index, int count ) : void
buffer Char
index int
count int
return void
Example #1
0
		/// <summary>
		/// Converts the object passed in to its XML representation.
		/// The XML string is written on the XmlTextWriter.
		/// </summary>
		public void ToXml(object value, FieldInfo field, XmlTextWriter xml, IMarshalContext context)
		{
			Type type = value.GetType();

			if ( value is char[] )
			{
				char[] buffer = value as char[];

				context.WriteStartTag( __arrayType, field, xml );
				xml.WriteChars( buffer, 0, buffer.Length );
				context.WriteEndTag( __arrayType, field, xml );
			}
			else
			{
				context.WriteStartTag( __type, field, xml );
				xml.WriteString( value.ToString() );
				context.WriteEndTag( __type, field, xml );
			}
		}