{
if (!(value is SqlString))
return false;
- if (this.IsNull && ((SqlString)value).IsNull)
- return true;
+ if (this.IsNull)
+ return ((SqlString)value).IsNull;
else if (((SqlString)value).IsNull)
return false;
else
#if NET_2_0
public static XmlQualifiedName GetXsdType (XmlSchemaSet schemaSet)
{
- XmlQualifiedName qualifiedName = new XmlQualifiedName ("string", "http://www.w3.org/2001/XMLSchema");
- return qualifiedName;
+ if (schemaSet != null && schemaSet.Count == 0) {
+ XmlSchema xs = new XmlSchema ();
+ XmlSchemaComplexType ct = new XmlSchemaComplexType ();
+ ct.Name = "string";
+ xs.Items.Add (ct);
+ schemaSet.Add (xs);
+ }
+ return new XmlQualifiedName ("string", "http://www.w3.org/2001/XMLSchema");
}
- [MonoTODO]
XmlSchema IXmlSerializable.GetSchema ()
{
- throw new NotImplementedException ();
+ return null;
}
- [MonoTODO]
void IXmlSerializable.ReadXml (XmlReader reader)
{
- throw new NotImplementedException ();
+ if (reader == null)
+ return;
+
+ switch (reader.ReadState) {
+ case ReadState.EndOfFile:
+ case ReadState.Error:
+ case ReadState.Closed:
+ return;
+ }
+ // Skip XML declaration and prolog
+ // or do I need to validate for the <string> tag?
+ reader.MoveToContent ();
+ if (reader.EOF)
+ return;
+
+ reader.Read ();
+ if (reader.NodeType == XmlNodeType.EndElement)
+ return;
+
+ if (reader.Value.Length > 0) {
+ if (String.Compare ("Null", reader.Value) == 0) {
+ // means a null reference/invalid value
+ notNull = false;
+ return;
+ }
+ // FIXME: Validate the value for expected format
+ this.value = reader.Value;
+ this.notNull = true;
+ this.compareOptions = SqlCompareOptions.IgnoreCase |
+ SqlCompareOptions.IgnoreKanaType |
+ SqlCompareOptions.IgnoreWidth;
+ }
}
- [MonoTODO]
void IXmlSerializable.WriteXml (XmlWriter writer)
{
- throw new NotImplementedException ();
+ writer.WriteString (this.ToString ());
}
#endif
}