| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- //
- // System.Data.Common.DataTableMappingCollection.cs
- //
- // Author:
- // Rodrigo Moya ([email protected])
- // Tim Coleman ([email protected])
- //
- // (C) Ximian, Inc
- // Copyright (C) 2002 Tim Coleman
- //
- using System;
- using System.Collections;
- namespace System.Data.Common
- {
- /// <summary>
- /// A collection of DataTableMapping objects. This class cannot be inherited.
- /// </summary>
- public sealed class DataTableMappingCollection :
- MarshalByRefObject, // ITableMappingCollection, IList,
- IEnumerable //ICollection,
- {
- private ArrayList mappingList;
- private ArrayList sourceTableList;
- private ArrayList dataSetTableList;
- public DataTableMappingCollection()
- {
- sourceTableList = new ArrayList ();
- dataSetTableList = new ArrayList ();
- mappingList = new ArrayList ();
- }
- public int Add (object value)
- {
- if (!(value is System.Data.Common.DataTableMapping))
- throw new SystemException ("The object passed in was not a DataTableMapping object.");
- string sourceTable = ((DataTableMapping)value).SourceTable;
- string dataSetTable = ((DataTableMapping)value).DataSetTable;
- mappingList.Add (value);
- dataSetTableList.Add (dataSetTable);
- return sourceTableList.Add (sourceTable);
- }
- public DataTableMapping Add (string sourceTable, string dataSetTable)
- {
- DataTableMapping dataTableMapping = new DataTableMapping (sourceTable, dataSetTable);
- mappingList.Add (dataTableMapping);
- sourceTableList.Add (sourceTable);
- dataSetTableList.Add (dataSetTable);
- return dataTableMapping ;
- }
- public void AddRange(DataTableMapping[] values)
- {
- foreach (DataTableMapping dataTableMapping in values)
- this.Add (dataTableMapping);
- }
- public void Clear()
- {
- sourceTableList.Clear ();
- dataSetTableList.Clear ();
- mappingList.Clear ();
- }
- public bool Contains (object value)
- {
- return mappingList.Contains (value);
- }
- public bool Contains (string value)
- {
- return sourceTableList.Contains (value);
- }
- [MonoTODO]
- public void CopyTo(Array array, int index)
- {
- throw new NotImplementedException ();
- }
- public DataTableMapping GetByDataSetTable (string dataSetTable)
- {
- return (DataTableMapping)mappingList[dataSetTableList.IndexOf(dataSetTable)];
- }
- [MonoTODO]
- public static DataTableMapping GetTableMappingBySchemaAction (DataTableMappingCollection tableMappings, string sourceTable, string dataSetTable, MissingMappingAction mappingAction)
- {
- throw new NotImplementedException ();
- }
- public int IndexOf (object value)
- {
- return mappingList.IndexOf (value);
- }
- public int IndexOf (string value)
- {
- return sourceTableList.IndexOf (value);
- }
- public int IndexOfDataSetTable (string dataSetTable)
- {
- return dataSetTableList.IndexOf (dataSetTable);
- }
- [MonoTODO]
- public void Insert (int index, object value)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public void Remove (object value)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public void RemoveAt (int index)
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public void RemoveAt (string index)
- {
- throw new NotImplementedException ();
- }
-
- [MonoTODO]
- public int Count
- {
- get { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public DataTableMapping this[int i] {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public DataTableMapping this[string s] {
- get { throw new NotImplementedException (); }
- set { throw new NotImplementedException (); }
- }
- [MonoTODO]
- public IEnumerator GetEnumerator ()
- {
- throw new NotImplementedException ();
- }
- }
- }
|