/// <summary>
/// Summary description for DataColumn.
/// </summary>
- public class DataColumn
+ public class DataColumn : MarshalByValueComponent
{
#region Fields
private long autoIncrementSeed = 0;
private long autoIncrementStep = 1;
private string caption = null;
- // FIXME: what does ms.net do for default of columnMapping
- // when not specified by the constructor?
- private MappingType columnMapping = MappingType.SimpleContent; // default?
+ private MappingType columnMapping = MappingType.Element;
private string columnName = null;
private Type dataType = null;
private object defaultValue = null;
public DataColumn(string columnName, Type dataType): this(columnName)
{
- if(dataType == null)
- {
+ if(dataType == null) {
throw new ArgumentNullException();
}
public bool AllowDBNull
{
- get
- {
+ get {
return allowDBNull;
}
- set
- {
+ set {
allowDBNull = value;
}
}
/// </remarks>
public bool AutoIncrement
{
- get
- {
+ get {
return autoIncrement;
}
- set
- {
+ set {
autoIncrement = value;
if(autoIncrement == true)
{
public long AutoIncrementSeed
{
- get
- {
+ get {
return autoIncrementSeed;
}
- set
- {
+ set {
autoIncrementSeed = value;
}
}
public long AutoIncrementStep
{
- get
- {
+ get {
return autoIncrementStep;
}
- set
- {
+ set {
autoIncrementStep = value;
}
}
public string Caption
{
- get
- {
+ get {
if(caption == null)
return columnName;
else
return caption;
}
- set
- {
+ set {
caption = value;
}
}
public virtual MappingType ColumnMapping
{
- get
- {
+ get {
return columnMapping;
}
- set
- {
+ set {
columnMapping = value;
}
}
public string ColumnName
{
- get
- {
+ get {
return columnName;
}
- set
- {
+ set {
columnName = value;
}
}
public Type DataType
{
- get
- {
+ get {
return dataType;
}
- set
- {
+ set {
if(AutoIncrement == true &&
Type.GetTypeCode(value) != TypeCode.Int32)
{
/// <remarks>When AutoIncrement is set to true, there can be no default value.</remarks>
public object DefaultValue
{
- get
- {
+ get {
return defaultValue;
}
- set
- {
+ set {
defaultValue = value;
}
}
public string Expression
{
- get
- {
+ get {
return expression;
}
- set
- {
+ set {
expression = value;
}
}
public PropertyCollection ExtendedProperties
{
- get
- {
+ get {
return extendedProperties;
}
}
public int MaxLength
{
- get
- {
+ get {
return maxLength;
}
- set
- {
+ set {
maxLength = value;
}
}
public string Namespace
{
- get
- {
+ get {
return nameSpace;
}
- set
- {
+ set {
nameSpace = value;
}
}
//Need a good way to set the Ordinal when the column is added to a columnCollection.
public int Ordinal
{
- get
- {
+ get {
return ordinal;
}
}
public string Prefix
{
- get
- {
+ get {
return prefix;
}
- set
- {
+ set {
prefix = value;
}
}
public bool ReadOnly
{
- get
- {
+ get {
return readOnly;
}
- set
- {
+ set {
readOnly = value;
}
}
public DataTable Table
{
- get
- {
+ get {
return table;
}
}
public bool Unique
{
- get
- {
+ get {
return unique;
}
- set
- {
+ set {
unique = value;
}
}
[MonoTODO]
public override string ToString()
{
- if(expression != null && expression != string.Empty)
- {
+ if (expression != null)
return expression;
- }
- else
- {
- return columnName;
- }
+
+ return columnName;
}
[MonoTODO]
{
#region Fields
- private ArrayList columns = new ArrayList();
- private ArrayList columnNames = new ArrayList();
+ private ArrayList columns = new ArrayList ();
+ private ArrayList columnNames = new ArrayList ();
private DataTable table = null;
+ private DataRowState rowState = DataRowState.Unchanged;
#endregion
#region Methods
[MonoTODO]
- public void AcceptChanges() {
+ public void AcceptChanges () {
throw new NotImplementedException ();
}
[MonoTODO]
public void CancelEdit() {
- throw new NotImplementedException ();
+ // FIXME: throw changes away
+ rowState = DataRowState.Unchanged;
}
[MonoTODO]
throw new NotImplementedException ();
}
- [MonoTODO]
public void Delete() {
- throw new NotImplementedException ();
+ rowState = DataRowState.Deleted;
}
[MonoTODO]
}
[MonoTODO]
- public DataRow[] GetChildRows(DataRelation dr) {
+ public DataRow[] GetChildRows (DataRelation dr) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow[] GetChildRows(string s) {
+ public DataRow[] GetChildRows (string s) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow[] GetChildRows(DataRelation dr, DataRowVersion version) {
+ public DataRow[] GetChildRows (DataRelation dr, DataRowVersion version) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow[] GetChildRows(string s, DataRowVersion version) {
+ public DataRow[] GetChildRows (string s, DataRowVersion version) {
throw new NotImplementedException ();
}
[MonoTODO]
- public string GetColumnError(DataColumn col) {
+ public string GetColumnError (DataColumn col) {
throw new NotImplementedException ();
}
[MonoTODO]
- public string GetColumnError(int index) {
+ public string GetColumnError (int index) {
throw new NotImplementedException ();
}
[MonoTODO]
- public string GetColumnError(string s) {
+ public string GetColumnError (string s) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataColumn[] GetColumnsInError() {
+ public DataColumn[] GetColumnsInError () {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow GetParentRow(DataRelation dr) {
+ public DataRow GetParentRow (DataRelation dr) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow GetParentRow(string s) {
+ public DataRow GetParentRow (string s) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow GetParentRow(DataRelation dr, DataRowVersion version) {
+ public DataRow GetParentRow (DataRelation dr, DataRowVersion version) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow GetParentRow(string s, DataRowVersion version) {
+ public DataRow GetParentRow (string s, DataRowVersion version) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow[] GetParentRows(DataRelation dr) {
+ public DataRow[] GetParentRows (DataRelation dr) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow[] GetParentRows(string s) {
+ public DataRow[] GetParentRows (string s) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow[] GetParentRows(DataRelation dr, DataRowVersion version) {
+ public DataRow[] GetParentRows (DataRelation dr, DataRowVersion version) {
throw new NotImplementedException ();
}
[MonoTODO]
- public DataRow[] GetParentRows(string s, DataRowVersion version) {
+ public DataRow[] GetParentRows (string s, DataRowVersion version) {
throw new NotImplementedException ();
}
[MonoTODO]
- public bool HasVersion(DataRowVersion version) {
+ public bool HasVersion (DataRowVersion version) {
throw new NotImplementedException ();
}
[MonoTODO]
- public bool IsNull(DataColumn dc) {
+ public bool IsNull (DataColumn dc) {
throw new NotImplementedException ();
}
[MonoTODO]
- public bool IsNull(int i) {
+ public bool IsNull (int i) {
throw new NotImplementedException ();
}
[MonoTODO]
- public bool IsNull(string s) {
+ public bool IsNull (string s) {
throw new NotImplementedException ();
}
[MonoTODO]
- public bool IsNull(DataColumn dc, DataRowVersion version) {
+ public bool IsNull (DataColumn dc, DataRowVersion version) {
throw new NotImplementedException ();
}
[MonoTODO]
- public void RejectChanges() {
- throw new NotImplementedException ();
+ public void RejectChanges () {
+ CancelEdit ();
}
[MonoTODO]
- public void SetColumnError(DataColumn dc, string err) {
+ public void SetColumnError (DataColumn dc, string err) {
throw new NotImplementedException ();
}
[MonoTODO]
- public void SetColumnError(int i, string err) {
+ public void SetColumnError (int i, string err) {
throw new NotImplementedException ();
}
[MonoTODO]
- public void SetColumnError(string a, string err) {
+ public void SetColumnError (string a, string err) {
throw new NotImplementedException ();
}
[MonoTODO]
- public void SetParentRow(DataRow row) {
+ public void SetParentRow (DataRow row) {
throw new NotImplementedException ();
}
[MonoTODO]
- public void SetParentRow(DataRow row, DataRelation rel) {
+ public void SetParentRow (DataRow row, DataRelation rel) {
throw new NotImplementedException ();
}
[MonoTODO]
- protected void SetNull(DataColumn column) {
+ protected void SetNull (DataColumn column) {
throw new NotImplementedException ();
}
public bool HasErrors {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
}
public object this[string s] {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
[MonoTODO]
- set { throw new NotImplementedException (); }
+ set {
+ throw new NotImplementedException ();
+ }
}
public object this[DataColumn dc] {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
[MonoTODO]
- set { throw new NotImplementedException (); }
+ set {
+ throw new NotImplementedException ();
+ }
}
public object this[int i] {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
[MonoTODO]
- set { throw new NotImplementedException (); }
+ set {
+ throw new NotImplementedException ();
+ }
}
public object this[string s, DataRowVersion version] {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
}
public object this[DataColumn dc, DataRowVersion version] {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
}
public object this[int i, DataRowVersion version] {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
}
public object[] ItemArray {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
[MonoTODO]
- set { throw new NotImplementedException (); }
+ set {
+ throw new NotImplementedException ();
+ }
}
public string RowError {
[MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ throw new NotImplementedException ();
+ }
[MonoTODO]
- set { throw new NotImplementedException (); }
+ set {
+ throw new NotImplementedException ();
+ }
}
public DataRowState RowState {
- [MonoTODO]
- get { throw new NotImplementedException (); }
+ get {
+ return rowState;
+ }
}
public DataTable Table {
/// Represents one table of in-memory data.
/// </summary>
[Serializable]
- public class DataTable : ISerializable
- /* MarshalByValueComponent, IListSource, ISupportInitialize,*/
+ public class DataTable : ISerializable
+ //MarshalByValueComponent, IListSource, ISupportInitialize
{
private bool _caseSensitive;
/// Intitalizes a new instance of the DataTable class with the specified table name.
/// </summary>
- public DataTable(string tableName)
+ public DataTable(string tableName) : this ()
{
- // _dataSet = null; // FIXME: temporarily commented
- // _defaultView = null; // FIXME: temporarily commented
- _columnCollection = new DataColumnCollection(this);
- //_constraintCollection = new ConstraintCollection(); TODO: uncomment after ConstraintCollection is built.
- _extendedProperties = null;
_tableName = tableName;
- _nameSpace = null;
- _caseSensitive = false;
- _displayExpression = null;
- _primaryKey = null;
-
- // FIXME: temporarily commented DataTableRelationCollection
- // _childRelations = new DataTableRelationCollection();
- // _parentRelations = new DataTableRelationCollection();
-
- //_nextRowID = 1;
- //_elementColumnCount = 0;
- //_caseSensitiveAmbient = true;
- //_culture = null; // _locale??
- //_compareFlags = 25; // why 25??
- //_fNestedInDataset = true; // what?
- _encodedTableName = tableName;
- //_xmlText = null; //??
- //_colUnique = null; //??
- //_textOnly = false; //??
- //repeatableElement = false; //??
- //zeroIntegers[]
- //zeroColumns[]
- //primaryIndex[]
- //delayedSetPrimaryKey = null; //??
}
/// <summary>
/// Initializes a new instance of the DataTable class with the SerializationInfo and the StreamingContext.
/// </summary>
- protected DataTable(SerializationInfo info, StreamingContext context)
+ protected DataTable(SerializationInfo info, StreamingContext context)
+ : this ()
{
//
// TODO: Add constructor logic here
public bool CaseSensitive
{
- get
- {
+ get {
return _caseSensitive;
}
- set
- {
+ set {
_caseSensitive = value;
}
}
public DataRelationCollection ChildRelations
{
- get
- {
+ get {
// FIXME: temporarily commented to compile
// return (DataRelationCollection)_childRelations;
throw new NotImplementedException ();
public DataColumnCollection Columns
{
- get
- {
+ get {
return _columnCollection;
}
}
public ConstraintCollection Constraints
{
- get
- {
+ get {
return _constraintCollection;
}
}
public string DisplayExpression
{
- get
- {
+ get {
return _displayExpression;
}
- set
- {
+ set {
_displayExpression = value;
}
}
/// </summary>
public PropertyCollection ExtendedProperties
{
- get
- {
+ get {
return _extendedProperties;
}
}
/// </summary>
public bool HasErrors
{
- get
- {
+ get {
return _hasErrors;
}
}
/// </summary>
public CultureInfo Locale
{
- get
- {
+ get {
return _locale;
}
- set
- {
+ set {
_locale = value;
}
}
/// </summary>
public int MinimumCapacity
{
- get
- {
+ get {
return _minimumCapacity;
}
- set
- {
+ set {
_minimumCapacity = value;
}
}
/// </summary>
public string Namespace
{
- get
- {
+ get {
return _nameSpace;
}
- set
- {
+ set {
_nameSpace = value;
}
}
/// </summary>
public DataRelationCollection ParentRelations
{
- get
- {
+ get {
// FIXME: temporarily commented to compile
// return _parentRelations;
throw new NotImplementedException ();
/// </summary>
public string Prefix
{
- get
- {
+ get {
return _prefix;
}
- set
- {
+ set {
_prefix = value;
}
}
/// </summary>
public DataColumn[] PrimaryKey
{
- get
- {
+ get {
return _primaryKey;
}
- set
- {
+ set {
_primaryKey = value;
}
}
public DataRowCollection Rows
{
- get
- {
+ get {
return _rows;
}
}
public virtual ISite Site
{
- get
- {
+ get {
return _site;
}
- set
- {
+ set {
_site = value;
}
}
public string TableName
{
- get
- {
+ get {
return _tableName;
}
- set
- {
+ set {
_tableName = value;
}
}
/* FIXME: implement IListSource
public bool IListSource.ContainsListCollection
{
- get
- {
+ get {
return _containsListCollection;
}
}
public void Clear()
{
+ _rows.Clear ();
}
/// <summary>
/// Gets an array of DataRow objects that contain errors.
/// </summary>
- //public DataRow[] GetErrors()
- //{
- // return _rows;
- //}
+ public DataRow[] GetErrors()
+ {
+ throw new NotImplementedException ();
+ }
/// <summary>
/// This member supports the .NET Framework infrastructure
/// </summary>
public DataRow NewRow()
{
- DataRow dataRow = new DataRow();
- dataRow.SetTable(this);
+ DataRow dataRow = new DataRow ();
+ dataRow.SetTable (this);
return dataRow;
}