if (isValueObject) id = _idGenerator.NextId;\r
else id = _idGenerator.GetId (obj, out firstTime);\r
\r
- if (obj.GetType() == typeof(string)) {\r
+ if (obj is string) {\r
WriteString (writer, id, (string)obj);\r
}\r
- else if (obj.GetType().IsArray) {\r
+ else if (obj is Array) {\r
WriteArray (writer, id, (Array)obj);\r
}\r
else\r
// Value types are written embedded in the containing object\r
WriteObjectInstance (writer, val, true);\r
}\r
- else if (val.GetType() == typeof(string))\r
+ else if (val is string)\r
{\r
// Strings are written embedded, unless already registered\r
bool firstTime;\r