return caseSensitive;
}
set {
- foreach (DataTable T in Tables) {
- if (T.VirginCaseSensitive)
- T.CaseSensitive = value;
- }
-
caseSensitive = value;
if (!caseSensitive) {
foreach (DataTable table in Tables) {
[DataSysDescription ("Indicates the XML uri namespace for the root element pointed at by this DataSet.")]
[DefaultValue ("")]
public string Namespace {
- [MonoTODO]
get { return _namespace; }
- [MonoTODO]
set {
//TODO - trigger an event if this happens?
- _namespace = value;
+ if (value != this._namespace)
+ RaisePropertyChanging ("Namespace");
+ _namespace = value;
}
}
[DataSysDescription ("Indicates the prefix of the namespace used for this DataSet.")]
[DefaultValue ("")]
public string Prefix {
- [MonoTODO]
get { return prefix; }
- [MonoTODO]
set {
- //TODO - trigger an event if this happens?
+ // Prefix cannot contain any special characters other than '_' and ':'
+ for (int i = 0; i < value.Length; i++) {
+ if (!(Char.IsLetterOrDigit (value [i])) && (value [i] != '_') && (value [i] != ':'))
+ throw new DataException ("Prefix '" + value + "' is not valid, because it contains special characters.");
+ }
+
if (value == null)
value = string.Empty;
return Copy;
}
- [MonoTODO]
private void CopyProperties (DataSet Copy)
{
Copy.CaseSensitive = CaseSensitive;
//Copy.DefaultViewManager
//Copy.DesignMode
Copy.EnforceConstraints = EnforceConstraints;
- //Copy.ExtendedProperties
- //Copy.HasErrors
- //Copy.Locale = Locale;
+ if(ExtendedProperties.Count > 0) {
+ // Cannot copy extended properties directly as the property does not have a set accessor
+ Array tgtArray = Array.CreateInstance( typeof (object), ExtendedProperties.Count);
+ ExtendedProperties.Keys.CopyTo (tgtArray, 0);
+ for (int i=0; i < ExtendedProperties.Count; i++)
+ Copy.ExtendedProperties.Add (tgtArray.GetValue (i), ExtendedProperties[tgtArray.GetValue (i)]);
+ }
+ Copy.Locale = Locale;
Copy.Namespace = Namespace;
Copy.Prefix = Prefix;
- //Copy.Site = Site;
+ //Copy.Site = Site; // FIXME : Not sure of this.
}
return false;
}
- [MonoTODO]
+ [MonoTODO ("Consider ignored namespace array")]
public void InferXmlSchema (XmlReader reader, string[] nsArray)
{
- throw new NotImplementedException ();
+ XmlDataLoader Loader = new XmlDataLoader (this);
+ Loader.LoadData (reader, XmlReadMode.InferSchema);
}
public void InferXmlSchema (Stream stream, string[] nsArray)
public void ReadXmlSchema (XmlReader reader)
{
+#if true
+ new XmlSchemaDataImporter (this, reader);
+#else
XmlSchemaMapper SchemaMapper = new XmlSchemaMapper (this);
SchemaMapper.Read (reader);
+#endif
}
public XmlReadMode ReadXml (Stream stream)
return mode;
}
}
- XmlSchemaMapper SchemaMapper = null;
// If schema, then read the first element as schema
if (reader.LocalName == "schema" && reader.NamespaceURI == XmlSchema.Namespace) {
switch (mode) {
// (and break up read)
return mode;
case XmlReadMode.Fragment:
- SchemaMapper = new XmlSchemaMapper (this);
- SchemaMapper.Read (reader);
+ ReadXmlSchema (reader);
// (and continue to read)
break;
+ case XmlReadMode.Auto:
+ if (Tables.Count == 0) {
+ ReadXmlSchema (reader);
+ return XmlReadMode.ReadSchema;
+ } else {
+ // otherwise just ignore and return IgnoreSchema
+ reader.Skip ();
+ return XmlReadMode.IgnoreSchema;
+ }
default:
- SchemaMapper = new XmlSchemaMapper (this);
- SchemaMapper.Read (reader);
+ ReadXmlSchema (reader);
// (and leave rest of the reader as is)
- return XmlReadMode.ReadSchema;
+ return mode; // When DiffGram, return DiffGram
}
}
// Otherwise, read as dataset... but only when required.