+2003-02-05 Alan Tam <Tam@suiLung.com>\r
+\r
+ * DataSet.cs: Added framework for DataSet.Update Implemented missing \r
+ methods GetSchemaSerializable, GetSerializationData, \r
+ ReadXmlSerializable, ShouldSerializeRelations and ShouldSerializeTables\r
+ for DataSet\r
+ * DataTable.cs: Implemented missing methods CreateInstance and \r
+ GetRowType for DataTable\r
+ \r
2003-02-03 Ville Palo <vi64pa@koti.soon.fi>\r
\r
* DataSet.cs: Implemented private method MapType for \r
// private DataTableRelationCollection relationCollection;
private PropertyCollection properties;
private DataViewManager defaultView;
+ private CultureInfo locale;
#region Constructors
[DataCategory ("Data")]
[DataSysDescription ("Indicates a locale under which to compare strings within the DataSet.")]
public CultureInfo Locale {
- [MonoTODO]
- get {
- throw new NotImplementedException ();
+ get {
+ return locale;
}
-
- [MonoTODO]
set {
- throw new NotImplementedException ();
+ if (locale == null || !locale.Equals(value)) {
+ // TODO: check if the new locale is valid
+ // TODO: update locale of all tables
+ locale = value;
+ }
}
}
+ [MonoTODO]
+ public void Merge (DataRow[] rows)
+ {
+ throw new NotImplementedException();
+ }
+
+ [MonoTODO]
+ public void Merge (DataSet dataSet)
+ {
+ throw new NotImplementedException();
+ }
+
+ [MonoTODO]
+ public void Merge (DataTable table)
+ {
+ throw new NotImplementedException();
+ }
+
+ [MonoTODO]
+ public void Merge (DataSet dataSet, bool preserveChanges)
+ {
+ throw new NotImplementedException();
+ }
+
+ [MonoTODO]
+ public void Merge (DataRow[] rows, bool preserveChanges, MissingSchemaAction missingSchemaAction)
+ {
+ throw new NotImplementedException();
+ }
+
+ [MonoTODO]
+ public void Merge (DataSet dataSet, bool preserveChanges, MissingSchemaAction missingSchemaAction)
+ {
+ throw new NotImplementedException();
+ }
+
+ [MonoTODO]
+ public void Merge (DataTable table, bool preserveChanges, MissingSchemaAction missingSchemaAction)
+ {
+ throw new NotImplementedException();
+ }
+
[DataCategory ("Data")]
[DataSysDescription ("Indicates the XML uri namespace for the root element pointed at by this DataSet.")]
[DefaultValue ("")]
}
#endregion
+ #region Protected Methods
+ protected virtual void GetSerializationData(SerializationInfo info, StreamingContext context)
+ {
+ string s = info.GetValue ("XmlDiffGram", typeof (String)) as String;
+ if (s != null) ReadXmlSerializable (new XmlTextReader(new StringReader(s)));
+ }
+
+ protected virtual System.Xml.Schema.XmlSchema GetSchemaSerializable()
+ {
+ return null; // FIXME
+ }
+
+ protected virtual void ReadXmlSerializable(XmlReader reader)
+ {
+ ReadXml(reader, XmlReadMode.DiffGram); // FIXME
+ }
+
+ protected virtual bool ShouldSerializeRelations ()
+ {
+ return true;
+ }
+
+ protected virtual bool ShouldSerializeTables ()
+ {
+ return true;
+ }
+ #endregion
+
#region Private Xml Serialisation
private void WriteTable( XmlWriter writer, DataTable table, XmlWriteMode mode )
/// and is not intended to be used directly from your code.
/// </summary>
- //protected virtual Type GetRowType()
- //{
- //}
+ protected virtual DataTable CreateInstance()
+ {
+ return Activator.CreateInstance(this.GetType(), true) as DataTable;
+ }
+
+ /// <summary>
+ /// This member supports the .NET Framework infrastructure
+ /// and is not intended to be used directly from your code.
+ /// </summary>
+
+ protected virtual Type GetRowType()
+ {
+ return typeof (DataRow);
+ }
/// <summary>
/// This member supports the .NET Framework infrastructure