Imported Upstream version 4.0.0~alpha1

Former-commit-id: 806294f5ded97629b74c85c09952f2a74fe182d9
This commit is contained in:
Jo Shields
2015-04-07 09:35:12 +01:00
parent 283343f570
commit 3c1f479b9d
22469 changed files with 2931443 additions and 869343 deletions

View File

@@ -45,15 +45,9 @@ namespace System.Data.OleDb
/// </summary>
[DesignerAttribute ("Microsoft.VSDesigner.Data.VS.OleDbCommandDesigner, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.ComponentModel.Design.IDesigner")]
[ToolboxItemAttribute ("System.Drawing.Design.ToolboxItem, "+ Consts.AssemblySystem_Drawing)]
#if NET_2_0
[DefaultEvent( "RecordsAffected")]
#endif
public sealed class OleDbCommand :
#if NET_2_0
DbCommand
#else
Component
#endif
, ICloneable, IDbCommand
{
#region Fields
@@ -112,15 +106,10 @@ namespace System.Data.OleDb
[DataCategory ("Data")]
[DefaultValue ("")]
#if !NET_2_0
[DataSysDescriptionAttribute ("Command text to execute.")]
#endif
[EditorAttribute ("Microsoft.VSDesigner.Data.ADO.Design.OleDbCommandTextEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
[RefreshPropertiesAttribute (RefreshProperties.All)]
public
#if NET_2_0
override
#endif
string CommandText {
get {
if (commandText == null)
@@ -132,14 +121,8 @@ namespace System.Data.OleDb
}
}
#if !NET_2_0
[DataSysDescriptionAttribute ("Time to wait for command to execute.")]
[DefaultValue (DEFAULT_COMMAND_TIMEOUT)]
#endif
public
#if NET_2_0
override
#endif
int CommandTimeout {
get {
return timeout;
@@ -151,14 +134,9 @@ namespace System.Data.OleDb
[DataCategory ("Data")]
[DefaultValue ("Text")]
#if !NET_2_0
[DataSysDescriptionAttribute ("How to interpret the CommandText.")]
#endif
[RefreshPropertiesAttribute (RefreshProperties.All)]
public
#if NET_2_0
override
#endif
CommandType CommandType {
get {
return commandType;
@@ -169,9 +147,6 @@ namespace System.Data.OleDb
}
[DataCategory ("Behavior")]
#if !NET_2_0
[DataSysDescriptionAttribute ("Connection used by the command.")]
#endif
[DefaultValue (null)]
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DbConnectionEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing )]
public new OleDbConnection Connection {
@@ -186,13 +161,9 @@ namespace System.Data.OleDb
[BrowsableAttribute (false)]
[DesignOnlyAttribute (true)]
[DefaultValue (true)]
#if NET_2_0
[EditorBrowsable(EditorBrowsableState.Never)]
#endif
public
#if NET_2_0
override
#endif
bool DesignTimeVisible {
get {
return designTimeVisible;
@@ -203,9 +174,6 @@ namespace System.Data.OleDb
}
[DataCategory ("Data")]
#if ONLY_1_1
[DataSysDescriptionAttribute ("The parameters collection.")]
#endif
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Content)]
public new OleDbParameterCollection Parameters {
get { return parameters; }
@@ -213,9 +181,6 @@ namespace System.Data.OleDb
}
[BrowsableAttribute (false)]
#if ONLY_1_1
[DataSysDescriptionAttribute ("The transaction used by the command.")]
#endif
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
public new OleDbTransaction Transaction {
get {
@@ -228,14 +193,9 @@ namespace System.Data.OleDb
[DataCategory ("Behavior")]
[DefaultValue (UpdateRowSource.Both)]
#if !NET_2_0
[DataSysDescriptionAttribute ("When used by a DataAdapter.Update, how command results are applied to the current DataRow.")]
#endif
[MonoTODO]
public
#if NET_2_0
override
#endif
UpdateRowSource UpdatedRowSource {
get { return updatedRowSource; }
set {
@@ -274,9 +234,7 @@ namespace System.Data.OleDb
[MonoTODO]
public
#if NET_2_0
override
#endif
void Cancel ()
{
throw new NotImplementedException ();
@@ -287,12 +245,6 @@ namespace System.Data.OleDb
return new OleDbParameter ();
}
#if !NET_2_0
IDbDataParameter IDbCommand.CreateParameter ()
{
return CreateParameter ();
}
#endif
protected override void Dispose (bool disposing)
{
@@ -332,9 +284,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
int ExecuteNonQuery ()
{
if (connection == null)
@@ -406,9 +356,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
object ExecuteScalar ()
{
SetupGdaCommand ();
@@ -425,11 +373,7 @@ namespace System.Data.OleDb
return o;
}
#if NET_2_0
public
#else
internal
#endif
OleDbCommand Clone ()
{
OleDbCommand command = new OleDbCommand ();
@@ -450,9 +394,7 @@ namespace System.Data.OleDb
[MonoTODO]
public
#if NET_2_0
override
#endif
void Prepare ()
{
throw new NotImplementedException ();
@@ -463,7 +405,6 @@ namespace System.Data.OleDb
timeout = DEFAULT_COMMAND_TIMEOUT;
}
#if NET_2_0
protected override DbParameter CreateDbParameter ()
{
return (DbParameter) CreateParameter ();
@@ -487,7 +428,6 @@ namespace System.Data.OleDb
get { return Transaction; }
set { Transaction = (OleDbTransaction) value; }
}
#endif
#endregion
}

View File

@@ -42,36 +42,17 @@ namespace System.Data.OleDb
/// Provides a means of automatically generating single-table commands used to reconcile changes made to a DataSet with the associated database. This class cannot be inherited.
/// </summary>
public sealed class OleDbCommandBuilder :
#if NET_2_0
DbCommandBuilder
#else
Component
#endif
{
#region Fields
OleDbDataAdapter adapter;
#if ONLY_1_1
string quotePrefix;
string quoteSuffix;
private DataTable _schema;
private string _tableName;
private OleDbCommand _insertCommand;
private OleDbCommand _updateCommand;
private OleDbCommand _deleteCommand;
bool _disposed;
#endif
#endregion // Fields
#region Constructors
public OleDbCommandBuilder ()
{
#if !NET_2_0
quotePrefix = String.Empty;
quoteSuffix = String.Empty;
#endif
}
public OleDbCommandBuilder (OleDbDataAdapter adapter)
@@ -84,9 +65,6 @@ namespace System.Data.OleDb
#region Properties
#if !NET_2_0
[DataSysDescriptionAttribute ("The DataAdapter for which to automatically generate OleDbCommands")]
#endif
[DefaultValue (null)]
public new OleDbDataAdapter DataAdapter {
get {
@@ -97,37 +75,11 @@ namespace System.Data.OleDb
}
}
#if !NET_2_0
[BrowsableAttribute (false)]
[DataSysDescriptionAttribute ("The prefix string wrapped around sql objects")]
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
public string QuotePrefix {
get {
return quotePrefix;
}
set {
quotePrefix = value;
}
}
[BrowsableAttribute (false)]
[DataSysDescriptionAttribute ("The suffix string wrapped around sql objects")]
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
public string QuoteSuffix {
get {
return quoteSuffix;
}
set {
quoteSuffix = value;
}
}
#endif
#endregion // Properties
#region Methods
#if NET_2_0
protected override void ApplyParameterInfo (DbParameter parameter,
DataRow datarow,
StatementType statementType,
@@ -143,7 +95,6 @@ namespace System.Data.OleDb
}
p.DbType = (DbType) datarow ["ProviderType"];
}
#endif
[MonoTODO]
public static void DeriveParameters (OleDbCommand command)
@@ -157,26 +108,6 @@ namespace System.Data.OleDb
throw new NotImplementedException ();
}
#if ONLY_1_1
protected override void Dispose (bool disposing)
{
if (_disposed)
return;
if (disposing) {
// dispose managed resource
if (_insertCommand != null) _insertCommand.Dispose ();
if (_updateCommand != null) _updateCommand.Dispose ();
if (_deleteCommand != null) _deleteCommand.Dispose ();
_insertCommand = null;
_updateCommand = null;
_deleteCommand = null;
_schema = null;
}
_disposed = true;
}
#endif
[MonoTODO]
public new OleDbCommand GetDeleteCommand ()
@@ -184,13 +115,11 @@ namespace System.Data.OleDb
throw new NotImplementedException ();
}
#if NET_2_0
[MonoTODO]
public new OleDbCommand GetDeleteCommand (bool useColumnsForParameterNames)
{
throw new NotImplementedException ();
}
#endif
[MonoTODO]
public new OleDbCommand GetInsertCommand ()
@@ -198,7 +127,6 @@ namespace System.Data.OleDb
throw new NotImplementedException ();
}
#if NET_2_0
[MonoTODO]
public new OleDbCommand GetInsertCommand (bool useColumnsForParameterNames)
{
@@ -220,7 +148,6 @@ namespace System.Data.OleDb
return GetParameterName (parameterOrdinal);
}
#endif
[MonoTODO]
public new OleDbCommand GetUpdateCommand ()
@@ -228,7 +155,6 @@ namespace System.Data.OleDb
throw new NotImplementedException ();
}
#if NET_2_0
[MonoTODO]
public new OleDbCommand GetUpdateCommand (bool useColumnsForParameterNames)
{
@@ -264,41 +190,6 @@ namespace System.Data.OleDb
{
throw new NotImplementedException ();
}
#else
private OleDbCommand SelectCommand
{
get {
if (DataAdapter == null)
return null;
return DataAdapter.SelectCommand;
}
}
public void RefreshSchema ()
{
// creates metadata
if (SelectCommand == null)
throw new InvalidOperationException ("SelectCommand should be valid");
if (SelectCommand.Connection == null)
throw new InvalidOperationException ("SelectCommand's Connection should be valid");
CommandBehavior behavior = CommandBehavior.SchemaOnly | CommandBehavior.KeyInfo;
if (SelectCommand.Connection.State != ConnectionState.Open) {
SelectCommand.Connection.Open ();
behavior |= CommandBehavior.CloseConnection;
}
OleDbDataReader reader = SelectCommand.ExecuteReader (behavior);
_schema = reader.GetSchemaTable ();
reader.Close ();
// force creation of commands
_insertCommand = null;
_updateCommand = null;
_deleteCommand = null;
_tableName = String.Empty;
}
#endif
#endregion // Methods
}

View File

@@ -36,18 +36,12 @@ using System.ComponentModel;
using System.Data;
using System.Data.Common;
using System.EnterpriseServices;
#if NET_2_0
using System.Transactions;
#endif
namespace System.Data.OleDb
{
[DefaultEvent ("InfoMessage")]
#if NET_2_0
public sealed class OleDbConnection : DbConnection, ICloneable
#else
public sealed class OleDbConnection : Component, ICloneable, IDbConnection
#endif
{
#region Fields
@@ -234,9 +228,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
void Open ()
{
// string provider = "Default";
@@ -304,7 +296,6 @@ namespace System.Data.OleDb
throw new NotImplementedException ();
}
#if NET_2_0
[MonoTODO]
public override void EnlistTransaction (Transaction transaction)
{
@@ -339,23 +330,14 @@ namespace System.Data.OleDb
{
throw new NotImplementedException ();
}
#endif
#endregion
#region Events and Delegates
#if !NET_2_0
[DataSysDescription ("Event triggered when messages arrive from the DataSource.")]
#endif
[DataCategory ("DataCategory_InfoMessage")]
public event OleDbInfoMessageEventHandler InfoMessage;
#if !NET_2_0
[DataSysDescription ("Event triggered when the connection changes state.")]
[DataCategory ("DataCategory_StateChange")]
public event StateChangeEventHandler StateChange;
#endif
#endregion
}

View File

@@ -80,9 +80,6 @@ namespace System.Data.OleDb
[DefaultValue (null)]
[DataCategory ("Update")]
#if !NET_2_0
[DataSysDescriptionAttribute ("Used during Update for deleted rows in DataSet.")]
#endif
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
public new OleDbCommand DeleteCommand {
get {
@@ -95,9 +92,6 @@ namespace System.Data.OleDb
[DefaultValue (null)]
[DataCategory ("Update")]
#if !NET_2_0
[DataSysDescriptionAttribute ("Used during Update for new rows in DataSet.")]
#endif
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
public new OleDbCommand InsertCommand {
get {
@@ -110,9 +104,6 @@ namespace System.Data.OleDb
[DefaultValue (null)]
[DataCategory ("Fill")]
#if !NET_2_0
[DataSysDescriptionAttribute ("Used during Fill/FillSchema.")]
#endif
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
public new OleDbCommand SelectCommand {
get {
@@ -125,9 +116,6 @@ namespace System.Data.OleDb
[DefaultValue (null)]
[DataCategory ("Update")]
#if !NET_2_0
[DataSysDescriptionAttribute ("Used during Update for modified rows in DataSet.")]
#endif
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBCommandEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
public new OleDbCommand UpdateCommand {
get { return updateCommand; }
@@ -209,27 +197,14 @@ namespace System.Data.OleDb
throw new NotImplementedException ();
}
#if !NET_2_0
[MonoTODO]
protected override void Dispose (bool disposing)
{
base.Dispose (disposing);
}
#endif
#endregion // Methods
#region Events and Delegates
#if !NET_2_0
[DataSysDescription ("Event triggered before every DataRow during Update.")]
#endif
[DataCategory ("DataCategory_Update")]
public event OleDbRowUpdatedEventHandler RowUpdated;
#if !NET_2_0
[DataSysDescription ("Event triggered after every DataRow during Update.")]
#endif
[DataCategory ("DataCategory_Update")]
public event OleDbRowUpdatingEventHandler RowUpdating;

View File

@@ -36,11 +36,7 @@ using System.Runtime.InteropServices;
namespace System.Data.OleDb
{
#if NET_2_0
public sealed class OleDbDataReader : DbDataReader, IDisposable
#else
public sealed class OleDbDataReader : MarshalByRefObject, IDataReader, IDisposable, IDataRecord, IEnumerable
#endif
{
#region Fields
@@ -72,9 +68,7 @@ namespace System.Data.OleDb
#region Properties
public
#if NET_2_0
override
#endif
int Depth {
get {
return 0; // no nested selects supported
@@ -82,9 +76,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
int FieldCount {
get {
if (currentResult < 0 || currentResult >= gdaResults.Count)
@@ -96,9 +88,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
bool IsClosed {
get {
return !open;
@@ -106,9 +96,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
object this[string name] {
get {
int pos;
@@ -127,9 +115,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
object this[int index] {
get {
return (object) GetValue (index);
@@ -137,9 +123,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
int RecordsAffected {
get {
int total_rows;
@@ -162,32 +146,26 @@ namespace System.Data.OleDb
[MonoTODO]
public
#if NET_2_0
override
#endif
bool HasRows {
get {
throw new NotImplementedException ();
}
}
#if NET_2_0
[MonoTODO]
public override int VisibleFieldCount {
get {
throw new NotImplementedException ();
}
}
#endif
#endregion
#region Methods
public
#if NET_2_0
override
#endif
void Close ()
{
for (int i = 0; i < gdaResults.Count; i++) {
@@ -204,9 +182,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
bool GetBoolean (int ordinal)
{
IntPtr value;
@@ -225,9 +201,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
byte GetByte (int ordinal)
{
IntPtr value;
@@ -247,9 +221,7 @@ namespace System.Data.OleDb
[MonoTODO]
public
#if NET_2_0
override
#endif
long GetBytes (int ordinal, long dataIndex, byte[] buffer, int bufferIndex, int length)
{
throw new NotImplementedException ();
@@ -257,9 +229,7 @@ namespace System.Data.OleDb
[EditorBrowsableAttribute (EditorBrowsableState.Never)]
public
#if NET_2_0
override
#endif
char GetChar (int ordinal)
{
IntPtr value;
@@ -279,34 +249,26 @@ namespace System.Data.OleDb
[MonoTODO]
public
#if NET_2_0
override
#endif
long GetChars (int ordinal, long dataIndex, char[] buffer, int bufferIndex, int length)
{
throw new NotImplementedException ();
}
[MonoTODO]
#if NET_2_0
[EditorBrowsable (EditorBrowsableState.Advanced)]
#endif
public new OleDbDataReader GetData (int ordinal)
{
throw new NotImplementedException ();
}
#if NET_2_0
protected override DbDataReader GetDbDataReader (int ordinal)
{
return this.GetData (ordinal);
}
#endif
public
#if NET_2_0
override
#endif
string GetDataTypeName (int index)
{
IntPtr attrs;
@@ -328,9 +290,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
DateTime GetDateTime (int ordinal)
{
IntPtr value;
@@ -371,18 +331,14 @@ namespace System.Data.OleDb
[MonoTODO]
public
#if NET_2_0
override
#endif
decimal GetDecimal (int ordinal)
{
throw new NotImplementedException ();
}
public
#if NET_2_0
override
#endif
double GetDouble (int ordinal)
{
IntPtr value;
@@ -401,9 +357,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
Type GetFieldType (int index)
{
IntPtr value;
@@ -436,9 +390,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
float GetFloat (int ordinal)
{
IntPtr value;
@@ -458,18 +410,14 @@ namespace System.Data.OleDb
[MonoTODO]
public
#if NET_2_0
override
#endif
Guid GetGuid (int ordinal)
{
throw new NotImplementedException ();
}
public
#if NET_2_0
override
#endif
short GetInt16 (int ordinal)
{
IntPtr value;
@@ -488,9 +436,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
int GetInt32 (int ordinal)
{
IntPtr value;
@@ -509,9 +455,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
long GetInt64 (int ordinal)
{
IntPtr value;
@@ -530,9 +474,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
string GetName (int index)
{
if (currentResult == -1)
@@ -543,9 +485,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
int GetOrdinal (string name)
{
if (currentResult == -1)
@@ -560,9 +500,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
DataTable GetSchemaTable ()
{
DataTable dataTableSchema = null;
@@ -686,9 +624,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
string GetString (int ordinal)
{
IntPtr value;
@@ -713,9 +649,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
object GetValue (int ordinal)
{
IntPtr value;
@@ -749,35 +683,20 @@ namespace System.Data.OleDb
[MonoTODO]
public
#if NET_2_0
override
#endif
int GetValues (object[] values)
{
throw new NotImplementedException ();
}
#if !NET_2_0
[MonoTODO]
IDataReader IDataRecord.GetData (int ordinal)
{
throw new NotImplementedException ();
}
#endif
#if NET_2_0
public override IEnumerator GetEnumerator()
#else
IEnumerator IEnumerable.GetEnumerator ()
#endif
{
return new DbEnumerator(this);
}
public
#if NET_2_0
override
#endif
bool IsDBNull (int ordinal)
{
IntPtr value;
@@ -794,9 +713,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
bool NextResult ()
{
int i = currentResult + 1;
@@ -809,9 +726,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
bool Read ()
{
if (currentResult < 0 || currentResult >= gdaResults.Count)
@@ -854,11 +769,6 @@ namespace System.Data.OleDb
Dispose (true);
}
#if ONLY_1_1
~OleDbDataReader () {
Dispose (false);
}
#endif
#endregion // Destructors
}
}

View File

@@ -106,12 +106,10 @@ namespace System.Data.OleDb
((OleDbError[]) (items.ToArray ())).CopyTo (array, index);
}
#if NET_2_0
public void CopyTo (OleDbError [] array, int index)
{
items.CopyTo (array, index);
}
#endif
public IEnumerator GetEnumerator ()
{

View File

@@ -42,11 +42,7 @@ using System.Runtime.Serialization;
namespace System.Data.OleDb
{
[Serializable]
#if NET_2_0
public sealed class OleDbException : DbException
#else
public sealed class OleDbException : ExternalException
#endif
{
private OleDbConnection connection;

View File

@@ -25,7 +25,6 @@
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
using System.Data.Common;
using System.Security;
using System.Security.Permissions;
@@ -76,5 +75,4 @@ namespace System.Data.OleDb {
}
}
}
#endif

View File

@@ -35,8 +35,5 @@ using System.Data.Common;
namespace System.Data.OleDb
{
#if !NET_2_0
[Serializable]
#endif
public delegate void OleDbInfoMessageEventHandler (object sender, OleDbInfoMessageEventArgs e);
}

View File

@@ -27,7 +27,6 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
#if NET_2_0
namespace System.Data.OleDb
{
@@ -47,4 +46,3 @@ namespace System.Data.OleDb
}
}
#endif

View File

@@ -39,13 +39,8 @@ using System.ComponentModel;
namespace System.Data.OleDb
{
#if NET_2_0
[TypeConverterAttribute ("System.Data.OleDb.OleDbParameter+OleDbParameterConverter, " + Consts.AssemblySystem_Data)]
public sealed class OleDbParameter : DbParameter, IDbDataParameter, ICloneable
#else
[TypeConverterAttribute (typeof (OleDbParameterConverter))]
public sealed class OleDbParameter : MarshalByRefObject, IDbDataParameter, IDataParameter, ICloneable
#endif
{
#region Fields
@@ -57,9 +52,7 @@ namespace System.Data.OleDb
byte scale;
DataRowVersion sourceVersion;
string sourceColumn;
#if NET_2_0
bool sourceColumnNullMapping;
#endif
ParameterDirection direction;
OleDbType oleDbType;
DbType dbType;
@@ -117,7 +110,6 @@ namespace System.Data.OleDb
this.value = value;
}
#if NET_2_0
[EditorBrowsable (EditorBrowsableState.Advanced)]
public OleDbParameter (string parameterName, OleDbType dbType, int size, ParameterDirection direction, byte precision, byte scale, string sourceColumn, DataRowVersion sourceVersion, bool sourceColumnNullMapping, object value)
: this (parameterName, dbType, size, sourceColumn)
@@ -129,23 +121,14 @@ namespace System.Data.OleDb
this.sourceColumnNullMapping = sourceColumnNullMapping;
this.value = value;
}
#endif
#endregion
#region Properties
#if !NET_2_0
[BrowsableAttribute (false)]
[DataSysDescriptionAttribute ("The parameter generic type.")]
[RefreshPropertiesAttribute (RefreshProperties.All)]
[DesignerSerializationVisibilityAttribute (DesignerSerializationVisibility.Hidden)]
#endif
[DataCategory ("DataCategory_Data")]
public
#if NET_2_0
override
#endif
DbType DbType {
get { return dbType; }
set {
@@ -154,44 +137,23 @@ namespace System.Data.OleDb
}
}
#if NET_2_0
[RefreshProperties (RefreshProperties.All)]
#else
[DataSysDescriptionAttribute ("Input, output, or bidirectional parameter.")]
[DefaultValue (ParameterDirection.Input)]
#endif
[DataCategory ("DataCategory_Data")]
public
#if NET_2_0
override
#endif
ParameterDirection Direction {
get { return direction; }
set { direction = value; }
}
#if !NET_2_0
[BrowsableAttribute (false)]
[DataSysDescriptionAttribute ("a design-time property used for strongly typed code-generation.")]
[DesignOnlyAttribute (true)]
[EditorBrowsableAttribute (EditorBrowsableState.Advanced)]
[DefaultValue (false)]
#endif
public
#if NET_2_0
override
#endif
bool IsNullable {
get { return isNullable; }
set { isNullable = value; }
}
#if NET_2_0
[DbProviderSpecificTypeProperty (true)]
#else
[DefaultValue (OleDbType.VarWChar)]
[DataSysDescriptionAttribute ("The parameter native type.")]
#endif
[RefreshPropertiesAttribute (RefreshProperties.All)]
[DataCategory ("DataCategory_Data")]
public OleDbType OleDbType {
@@ -202,23 +164,14 @@ namespace System.Data.OleDb
}
}
#if !NET_2_0
[DefaultValue ("")]
[DataSysDescriptionAttribute ("Name of the parameter.")]
#endif
public
#if NET_2_0
override
#endif
string ParameterName {
get { return name; }
set { name = value; }
}
[DefaultValue (0)]
#if !NET_2_0
[DataSysDescriptionAttribute ("For decimal, numeric, varnumeric DBTypes.")]
#endif
[DataCategory ("DataCategory_Data")]
public byte Precision {
get { return precision; }
@@ -226,44 +179,28 @@ namespace System.Data.OleDb
}
[DefaultValue (0)]
#if !NET_2_0
[DataSysDescriptionAttribute ("For decimal, numeric, varnumeric DBTypes.")]
#endif
[DataCategory ("DataCategory_Data")]
public byte Scale {
get { return scale; }
set { scale = value; }
}
#if !NET_2_0
[DefaultValue (0)]
[DataSysDescriptionAttribute ("Size of variable length data types (string & arrays).")]
#endif
[DataCategory ("DataCategory_Data")]
public
#if NET_2_0
override
#endif
int Size {
get { return size; }
set { size = value; }
}
#if !NET_2_0
[DefaultValue ("")]
[DataSysDescriptionAttribute ("When used by a DataAdapter.Update, the source column name that is used to find the DataSetColumn name in the ColumnMappings. This is to copy a value between the parameter and a datarow.")]
#endif
[DataCategory ("DataCategory_Data")]
public
#if NET_2_0
override
#endif
string SourceColumn {
get { return sourceColumn; }
set { sourceColumn = value; }
}
#if NET_2_0
public override bool SourceColumnNullMapping {
get {
return sourceColumnNullMapping;
@@ -271,34 +208,20 @@ namespace System.Data.OleDb
sourceColumnNullMapping = value;
}
}
#endif
#if !NET_2_0
[DefaultValue (DataRowVersion.Current)]
[DataSysDescriptionAttribute ("When used by a DataAdapter.Update (UpdateCommand only), the version of the DataRow value that is used to update the data source.")]
#endif
[DataCategory ("DataCategory_Data")]
public
#if NET_2_0
override
#endif
DataRowVersion SourceVersion {
get { return sourceVersion; }
set { sourceVersion = value; }
}
#if NET_2_0
[RefreshPropertiesAttribute (RefreshProperties.All)]
#else
[DefaultValue (null)]
[DataSysDescriptionAttribute ("Value of the parameter.")]
#endif
[TypeConverter (typeof (StringConverter))]
[DataCategory ("DataCategory_Data")]
public
#if NET_2_0
override
#endif
object Value {
get { return value; }
set { this.value = value; }
@@ -329,7 +252,6 @@ namespace System.Data.OleDb
throw new NotImplementedException ();
}
#if NET_2_0
public override void ResetDbType ()
{
ResetOleDbType ();
@@ -340,7 +262,6 @@ namespace System.Data.OleDb
oleDbType = GetOleDbType (Value);
dbType = OleDbTypeToDbType (oleDbType);
}
#endif
public override string ToString ()
{

View File

@@ -44,11 +44,7 @@ namespace System.Data.OleDb
[ListBindable (false)]
[EditorAttribute ("Microsoft.VSDesigner.Data.Design.DBParametersEditor, "+ Consts.AssemblyMicrosoft_VSDesigner, "System.Drawing.Design.UITypeEditor, "+ Consts.AssemblySystem_Drawing)]
public sealed class OleDbParameterCollection :
#if NET_2_0
DbParameterCollection, IList, ICollection, IDataParameterCollection
#else
MarshalByRefObject, IDataParameterCollection, IList, ICollection, IEnumerable
#endif
{
#region Fields
@@ -66,14 +62,8 @@ namespace System.Data.OleDb
#region Properties
#if ONLY_1_1
[Browsable (false)]
[DesignerSerializationVisibility (DesignerSerializationVisibility.Hidden)]
#endif
public
#if NET_2_0
override
#endif
int Count {
get { return list.Count; }
}
@@ -101,7 +91,6 @@ namespace System.Data.OleDb
}
}
#if NET_2_0
public override bool IsFixedSize {
get {
return list.IsFixedSize;
@@ -125,39 +114,6 @@ namespace System.Data.OleDb
return list.SyncRoot;
}
}
#else
bool IList.IsFixedSize {
get { return false; }
}
bool IList.IsReadOnly {
get { return false; }
}
bool ICollection.IsSynchronized {
get { return list.IsSynchronized; }
}
object ICollection.SyncRoot {
get { return list.SyncRoot; }
}
object IList.this[int index] {
get { return list[index]; }
set { list[index] = value; }
}
object IDataParameterCollection.this [string index] {
[MonoTODO]
get {
throw new NotImplementedException ();
}
[MonoTODO]
set {
throw new NotImplementedException ();
}
}
#endif
internal IntPtr GdaParameterList {
[MonoTODO]
@@ -175,13 +131,9 @@ namespace System.Data.OleDb
#region Methods
#if NET_2_0
[EditorBrowsable(EditorBrowsableState.Never)]
#endif
public
#if NET_2_0
override
#endif
int Add (object value)
{
if (!(value is OleDbParameter))
@@ -199,21 +151,17 @@ namespace System.Data.OleDb
return value;
}
#if NET_2_0
[Obsolete("OleDbParameterCollection.Add(string, value) is now obsolete. Use OleDbParameterCollection.AddWithValue(string, object) instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
#endif
public OleDbParameter Add (string parameterName, object value)
{
return Add (new OleDbParameter (parameterName, value));
}
#if NET_2_0
public OleDbParameter AddWithValue (string parameterName, object value)
{
return Add (new OleDbParameter (parameterName, value));
}
#endif
public OleDbParameter Add (string parameterName, OleDbType oleDbType)
{
@@ -230,7 +178,6 @@ namespace System.Data.OleDb
return Add (new OleDbParameter (parameterName, oleDbType, size, sourceColumn));
}
#if NET_2_0
public override void AddRange(Array values)
{
if (values == null)
@@ -248,12 +195,9 @@ namespace System.Data.OleDb
foreach (OleDbParameter value in values)
Add (value);
}
#endif
public
#if NET_2_0
override
#endif
void Clear()
{
foreach (OleDbParameter p in list)
@@ -262,9 +206,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
bool Contains (object value)
{
if (!(value is OleDbParameter))
@@ -273,9 +215,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
bool Contains (string value)
{
foreach (OleDbParameter p in list)
@@ -284,39 +224,30 @@ namespace System.Data.OleDb
return false;
}
#if NET_2_0
public bool Contains (OleDbParameter value)
{
return IndexOf (value) != -1;
}
#endif
public
#if NET_2_0
override
#endif
void CopyTo (Array array, int index)
{
list.CopyTo (array, index);
}
#if NET_2_0
public void CopyTo(OleDbParameter[] array, int index)
{
CopyTo (array, index);
}
#endif
public
#if NET_2_0
override
#endif
IEnumerator GetEnumerator()
{
return list.GetEnumerator ();
}
#if NET_2_0
[MonoTODO]
protected override DbParameter GetParameter (int index)
{
@@ -328,12 +259,9 @@ namespace System.Data.OleDb
{
throw new NotImplementedException ();
}
#endif
public
#if NET_2_0
override
#endif
int IndexOf (object value)
{
if (!(value is OleDbParameter))
@@ -341,17 +269,13 @@ namespace System.Data.OleDb
return IndexOf (((OleDbParameter) value).ParameterName);
}
#if NET_2_0
public int IndexOf(OleDbParameter value)
{
return IndexOf (value);
}
#endif
public
#if NET_2_0
override
#endif
int IndexOf (string parameterName)
{
for (int i = 0; i < Count; i += 1)
@@ -361,42 +285,32 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
void Insert (int index, object value)
{
list.Insert (index, value);
}
#if NET_2_0
public void Insert (int index, OleDbParameter value)
{
Insert (index, value);
}
#endif
public
#if NET_2_0
override
#endif
void Remove (object value)
{
((OleDbParameter) value).Container = null;
list.Remove (value);
}
#if NET_2_0
public void Remove (OleDbParameter value)
{
Remove (value);
}
#endif
public
#if NET_2_0
override
#endif
void RemoveAt (int index)
{
this [index].Container = null;
@@ -404,15 +318,12 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
void RemoveAt (string parameterName)
{
RemoveAt (IndexOf (parameterName));
}
#if NET_2_0
[MonoTODO]
protected override void SetParameter (int index, DbParameter value)
{
@@ -424,7 +335,6 @@ namespace System.Data.OleDb
{
throw new NotImplementedException ();
}
#endif
#endregion // Methods
}

View File

@@ -61,11 +61,9 @@ namespace System.Data.OleDb {
#region Properties
#if NET_2_0
[Obsolete ()]
[BrowsableAttribute (false)]
[EditorBrowsableAttribute (EditorBrowsableState.Never)]
#endif
public string Provider {
get {
if (_provider == null)
@@ -82,9 +80,6 @@ namespace System.Data.OleDb {
public override IPermission CreatePermission ()
{
OleDbPermission p = new OleDbPermission (this);
#if !NET_2_0
p.Provider = _provider;
#endif
return p;
}

View File

@@ -35,9 +35,6 @@ using System.Data.Common;
namespace System.Data.OleDb
{
#if !NET_2_0
[Serializable]
#endif
public delegate void OleDbRowUpdatedEventHandler (
object sender,
OleDbRowUpdatedEventArgs e);

View File

@@ -55,7 +55,6 @@ namespace System.Data.OleDb
set { base.Command = value; }
}
#if NET_2_0
protected override IDbCommand BaseCommand {
get {
return base.BaseCommand;
@@ -64,7 +63,6 @@ namespace System.Data.OleDb
base.BaseCommand = value;
}
}
#endif
#endregion
}

View File

@@ -35,9 +35,6 @@ using System.Data.Common;
namespace System.Data.OleDb
{
#if !NET_2_0
[Serializable]
#endif
public delegate void OleDbRowUpdatingEventHandler (
object sender,
OleDbRowUpdatingEventArgs e);

View File

@@ -33,11 +33,7 @@ using System.Data.Common;
namespace System.Data.OleDb
{
#if NET_2_0
public sealed class OleDbTransaction : DbTransaction, IDbTransaction
#else
public sealed class OleDbTransaction : MarshalByRefObject, IDbTransaction, IDisposable
#endif
{
#region Fields
@@ -106,22 +102,12 @@ namespace System.Data.OleDb
}
}
#if NET_2_0
protected override DbConnection DbConnection {
get { return connection; }
}
#else
IDbConnection IDbTransaction.Connection {
get {
return connection;
}
}
#endif
public
#if NET_2_0
override
#endif
IsolationLevel IsolationLevel {
get {
if (!isOpen)
@@ -160,9 +146,7 @@ namespace System.Data.OleDb
}
public
#if NET_2_0
override
#endif
void Commit ()
{
if (!isOpen)
@@ -175,17 +159,8 @@ namespace System.Data.OleDb
isOpen = false;
}
#if ONLY_1_1
~OleDbTransaction ()
{
libgda.FreeObject (gdaTransaction);
gdaTransaction = IntPtr.Zero;
}
#endif
#if NET_2_0
protected override
#endif
void Dispose (bool disposing)
{
if (!disposed) {
@@ -194,22 +169,12 @@ namespace System.Data.OleDb
disposed = true;
}
#if NET_2_0
base.Dispose (disposing);
#endif
}
#if !NET_2_0
void IDisposable.Dispose ()
{
Dispose (true);
}
#endif
public
#if NET_2_0
override
#endif
void Rollback ()
{
if (!isOpen)