public override void WriteEndAttribute ()
{
CheckState ();
if (state != WriteState.Attribute)
throw new XmlException ("Cannot close attribute, as this XmlDictionaryWriter is not at attribute state");
if (attr_name == "type") {
switch (attr_value) {
case "object":
element_kinds.Pop ();
element_kinds.Push (ElementType.Object);
OutputAsciiChar ('{');
break;
case "array":
element_kinds.Pop ();
element_kinds.Push (ElementType.Array);
OutputAsciiChar ('[');
break;
case "number":
element_kinds.Pop ();
element_kinds.Push (ElementType.Number);
break;
case "boolean":
element_kinds.Pop ();
element_kinds.Push (ElementType.Boolean);
break;
case "string":
element_kinds.Pop ();
element_kinds.Push (ElementType.String);
break;
default:
throw new XmlException (String.Format ("Unexpected type attribute value '{0}'", attr_value));
}
}
else
runtime_type = attr_value;
state = WriteState.Element;
attr_value = null;
}