diff options
author | Miguel de Icaza <miguel@gnome.org> | 2012-06-02 02:04:16 +0400 |
---|---|---|
committer | Miguel de Icaza <miguel@gnome.org> | 2012-06-02 02:04:24 +0400 |
commit | ae0feab435b09517ef942c55ff660fa22406b57b (patch) | |
tree | 24c6c7cbe940eb93e59a104cdc3d83f6a1542009 /mcs/class/System.Data | |
parent | 00620f0ef0dfc5886381dc8c0f83368ac9dcdbe9 (diff) |
Removal of NET_1_1 defines and some NET_2_0; Both defines are true these days in Mono, no versions prior to 2.0 are supported
Diffstat (limited to 'mcs/class/System.Data')
12 files changed, 1 insertions, 180 deletions
diff --git a/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs b/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs index bfb97364f16..ccc45404d64 100644 --- a/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs +++ b/mcs/class/System.Data/System.Data.Common/DbDataPermissionAttribute.cs @@ -45,10 +45,8 @@ namespace System.Data.Common { bool allowBlankPassword; string keyRestrictions; -#if NET_1_1 KeyRestrictionBehavior keyRestrictionBehavior; string connectionString; -#endif #endregion // Fields @@ -77,7 +75,6 @@ namespace System.Data.Common { set { keyRestrictions = value; } } -#if NET_1_1 public string ConnectionString { get { if (connectionString == null) @@ -94,12 +91,10 @@ namespace System.Data.Common { keyRestrictionBehavior = value; } } -#endif #endregion // Properties #region // Methods -#if NET_2_0 [EditorBrowsableAttribute (EditorBrowsableState.Never)] public bool ShouldSerializeConnectionString () { @@ -113,7 +108,6 @@ namespace System.Data.Common { // FIXME: configurable ? why is this in the attribute class ? return false; } -#endif #endregion // Methods } } diff --git a/mcs/class/System.Data/System.Data.Odbc/OdbcPermission.cs b/mcs/class/System.Data/System.Data.Odbc/OdbcPermission.cs index da7db7e807f..a198de6bb2c 100644 --- a/mcs/class/System.Data/System.Data.Odbc/OdbcPermission.cs +++ b/mcs/class/System.Data/System.Data.Odbc/OdbcPermission.cs @@ -38,9 +38,7 @@ namespace System.Data.Odbc { #region Constructors -#if NET_1_1 [Obsolete ("use OdbcPermission(PermissionState.None)", true)] -#endif public OdbcPermission () : base (PermissionState.None) { @@ -51,9 +49,7 @@ namespace System.Data.Odbc { } -#if NET_1_1 [Obsolete ("use OdbcPermission(PermissionState.None)", true)] -#endif public OdbcPermission (PermissionState state, bool allowBlankPassword) : base (state) { diff --git a/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs b/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs index 44797ea1784..af23b58cd72 100644 --- a/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs +++ b/mcs/class/System.Data/System.Data.OleDb/OleDbPermission.cs @@ -48,9 +48,7 @@ namespace System.Data.OleDb #region Constructors -#if NET_1_1 [Obsolete ("use OleDbPermission(PermissionState.None)", true)] -#endif public OleDbPermission () : base (PermissionState.None) { @@ -61,9 +59,7 @@ namespace System.Data.OleDb { } -#if NET_1_1 [Obsolete ("use OleDbPermission(PermissionState.None)", true)] -#endif public OleDbPermission (PermissionState state, bool allowBlankPassword) : base (state) { @@ -86,11 +82,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) @@ -108,36 +102,6 @@ namespace System.Data.OleDb { return new OleDbPermission (this); } - -#if !NET_2_0 - // methods required to support Provider were removed in Fx 2.0 - // i.e. Provider isn't included in the XML output - - public override void FromXml (SecurityElement securityElement) - { - base.FromXml (securityElement); - // Provider - } - - [MonoTODO ("is it worth to implement as it is being removed ?")] - public override IPermission Intersect (IPermission target) - { - return base.Intersect (target); - } - - public override SecurityElement ToXml () - { - SecurityElement se = base.ToXml (); - // add Provider - return se; - } - - [MonoTODO ("is it worth to implement as it is being removed ?")] - public override IPermission Union (IPermission target) - { - return base.Union (target); - } -#endif #endregion } } diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs index 7b141315d9e..c66bf3328c2 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlClientPermission.cs @@ -85,12 +85,10 @@ namespace System.Data.SqlClient { return new SqlClientPermission (this); } -#if NET_1_1 public override void Add (string connectionString, string restrictions, KeyRestrictionBehavior behavior) { base.Add (connectionString, restrictions, behavior); } -#endif #endregion // Methods } } diff --git a/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs b/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs index 0dd0da89ecc..542a564bd1b 100644 --- a/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs +++ b/mcs/class/System.Data/System.Data.SqlClient/SqlException.cs @@ -45,12 +45,7 @@ using Mono.Data.Tds.Protocol; namespace System.Data.SqlClient { [Serializable] - public sealed class SqlException -#if NET_2_0 - : DbException -#else - : SystemException -#endif //NET_1_1 + public sealed class SqlException : DbException { #region Fields diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs index a6fab12a907..c7c0468ab21 100644 --- a/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs +++ b/mcs/class/System.Data/System.Data.SqlTypes/SqlNullValueException.cs @@ -34,9 +34,7 @@ using System.Runtime.Serialization; namespace System.Data.SqlTypes { -#if NET_1_1 [Serializable] -#endif public sealed class SqlNullValueException : SqlTypeException, ISerializable { public SqlNullValueException () diff --git a/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs b/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs index 15312cd35d5..ca476adc08a 100644 --- a/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs +++ b/mcs/class/System.Data/System.Data.SqlTypes/SqlTruncateException.cs @@ -34,9 +34,7 @@ using System.Runtime.Serialization; namespace System.Data.SqlTypes { -#if NET_1_1 [Serializable] -#endif public sealed class SqlTruncateException : SqlTypeException, ISerializable { public SqlTruncateException () diff --git a/mcs/class/System.Data/System.Data/DataRowCollection.cs b/mcs/class/System.Data/System.Data/DataRowCollection.cs index 3cef9793b8e..fbbc7e932ba 100644 --- a/mcs/class/System.Data/System.Data/DataRowCollection.cs +++ b/mcs/class/System.Data/System.Data/DataRowCollection.cs @@ -123,11 +123,7 @@ namespace System.Data /// <summary> /// Creates a row using specified values and adds it to the DataRowCollection. /// </summary> -#if NET_2_0 public DataRow Add (params object[] values) -#else - public virtual DataRow Add (object[] values) -#endif { if (values == null) throw new NullReferenceException (); @@ -155,24 +151,16 @@ namespace System.Data string err = String.Format ("Cannot clear table Parent because " + "ForeignKeyConstraint {0} enforces Child.", uc.ConstraintName); -#if NET_1_1 throw new InvalidConstraintException (err); -#else - throw new ArgumentException (err); -#endif } } -#if NET_2_0 table.DataTableClearing (); -#endif List.Clear (); // Remove from indexes table.ResetIndexes (); -#if NET_2_0 table.DataTableCleared (); -#endif OnListChanged (this, new ListChangedEventArgs (ListChangedType.Reset, -1, -1)); } @@ -340,7 +328,6 @@ namespace System.Data } } -#if NET_2_0 sealed partial class DataRowCollection { public override int Count { get { return List.Count; } @@ -361,15 +348,4 @@ namespace System.Data return base.GetEnumerator (); } } -#else - [Serializable] - partial class DataRowCollection { - /// <summary> - /// This member overrides InternalDataCollectionBase.List - /// </summary> - protected override ArrayList List { - get { return base.List; } - } - } -#endif } diff --git a/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionTest.cs b/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionTest.cs index 652160d14bc..9c2842619f4 100644 --- a/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionTest.cs +++ b/mcs/class/System.Data/Test/System.Data.Common/DBDataPermissionTest.cs @@ -97,44 +97,6 @@ namespace MonoTests.System.Data.Common { Assert.AreEqual (count, dbdp.ToXml ().Children.Count, msg + ".Count"); } -#if !NET_2_0 - [Test] - public void Constructor_Empty () - { - NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (); - Check ("Empty", dbdp, false, false, 0); - } -#elif !NET_1_1 - [Test] - [ExpectedException (typeof (ArgumentOutOfRangeException))] - public void Constructor_PermissionStateBoolean_Invalid () - { - PermissionState ps = (PermissionState) Int32.MinValue; - NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (ps, false); - } - - [Test] - public void Constructor_PermissionStateBoolean_None () - { - PermissionState ps = PermissionState.None; - NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (ps, false); - Check ("None,False", dbdp, false, false, 0); - - dbdp = new NonAbstractDBDataPermission (ps, true); - Check ("None,True", dbdp, true, false, 0); - } - - [Test] - public void Constructor_PermissionStateBoolean_Unrestricted () - { - PermissionState ps = PermissionState.Unrestricted; - NonAbstractDBDataPermission dbdp = new NonAbstractDBDataPermission (ps, false); - Check ("Unrestricted,False", dbdp, false, true, 0); - - dbdp = new NonAbstractDBDataPermission (ps, true); - Check ("Unrestricted,True", dbdp, true, true, 0); - } -#endif [Test] [ExpectedException (typeof (ArgumentNullException))] public void Constructor_DBDataPermission_Null () diff --git a/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs b/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs index 10af5ada60f..26e1301417c 100644 --- a/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs +++ b/mcs/class/System.Data/Test/System.Data/ConstraintCollectionTest.cs @@ -101,17 +101,9 @@ namespace MonoTests.System.Data _constraint2.ConstraintName = "dog"; //case insensitive col.Add (_constraint1); col.Add (_constraint2); -#if NET_1_1 -#else - Assert.Fail ("Failed to throw Duplicate name exception."); -#endif col.Remove (_constraint2); // only for !1.0 col.Remove (_constraint1); } -#if ! NET_1_1 - catch (DuplicateNameException) { - } -#endif catch (AssertionException exc) { throw exc; } @@ -124,16 +116,8 @@ namespace MonoTests.System.Data //Constraint Already exists try { col.Add (_constraint1); -#if NET_1_1 -#else - Assert.Fail ("B2: Failed to throw ArgumentException."); -#endif col.Remove (_constraint1); } catch (ArgumentException) { -#if NET_1_1 -#else - throw; -#endif } catch (AssertionException exc) { throw exc; } catch { diff --git a/mcs/class/System.Data/Test/System.Data/DataTableTest.cs b/mcs/class/System.Data/Test/System.Data/DataTableTest.cs index f1c7f78b463..2a9db1a1582 100644 --- a/mcs/class/System.Data/Test/System.Data/DataTableTest.cs +++ b/mcs/class/System.Data/Test/System.Data/DataTableTest.cs @@ -899,7 +899,6 @@ namespace MonoTests.System.Data Assert.AreEqual ("Error#1", (table.GetErrors ())[0].RowError, "#A02"); } -#if NET_2_0 [Test] public void NewRowAddedTest () { @@ -924,7 +923,6 @@ namespace MonoTests.System.Data Assert.IsTrue (_tableNewRowAddedEventFired, "#NewRowAdded Event #01"); } -#endif [Test] public void CloneCopyTest () @@ -983,11 +981,6 @@ namespace MonoTests.System.Data DataColumn[] colArray = {table.Columns[0]}; table.PrimaryKey = colArray; table.ExtendedProperties.Add ("TimeStamp", DateTime.Now); -#if NET_1_1 // This prevents further tests after .NET 1.1. -#else - CultureInfo cultureInfo = new CultureInfo ("en-gb"); - table.Locale = cultureInfo; -#endif row = table1.NewRow (); row ["Name"] = "Abc"; @@ -1012,10 +1005,6 @@ namespace MonoTests.System.Data Assert.AreEqual ("Id / Name + (Id * Id)", cloneTable.DisplayExpression, "#A06"); Assert.AreEqual (1, cloneTable.ExtendedProperties.Count, "#A07"); Assert.IsFalse (cloneTable.HasErrors, "#A08"); -#if NET_1_1 -#else - Assert.AreEqual (2057, cloneTable.Locale.LCID, "#A09"); -#endif Assert.AreEqual (100, cloneTable.MinimumCapacity, "#A10"); Assert.AreEqual ("Namespace#1", cloneTable.Namespace, "#A11"); Assert.AreEqual ("PrefixNo:1", cloneTable.Prefix, "#A12"); @@ -1033,10 +1022,6 @@ namespace MonoTests.System.Data Assert.AreEqual ("Id / Name + (Id * Id)", copyTable.DisplayExpression, "#A21"); Assert.AreEqual (1, copyTable.ExtendedProperties.Count, "#A22"); Assert.IsTrue (copyTable.HasErrors, "#A23"); -#if NET_1_1 -#else - Assert.AreEqual (2057, copyTable.Locale.LCID, "#A24"); -#endif Assert.AreEqual (100, copyTable.MinimumCapacity, "#A25"); Assert.AreEqual ("Namespace#1", copyTable.Namespace, "#A26"); Assert.AreEqual ("PrefixNo:1", copyTable.Prefix, "#A27"); @@ -1446,11 +1431,7 @@ namespace MonoTests.System.Data // clear test table.Clear (); Assert.AreEqual (0, table.Rows.Count, "#A08"); -#if NET_1_1 Assert.AreEqual (0, table.Constraints.Count, "#A09"); -#else - Assert.AreEqual (1, table.Constraints.Count, "#A09"); -#endif Assert.AreEqual (0, table.ChildRelations.Count, "#A10"); } @@ -1469,18 +1450,14 @@ namespace MonoTests.System.Data table.Rows.Add (new object [] { 4, "mono 4" }); table.AcceptChanges (); -#if NET_2_0 _tableClearedEventFired = false; table.TableCleared += new DataTableClearEventHandler (OnTableCleared); _tableClearingEventFired = false; table.TableClearing += new DataTableClearEventHandler (OnTableClearing); -#endif // NET_2_0 table.Clear (); -#if NET_2_0 Assert.IsTrue (_tableClearingEventFired, "#3 should have fired cleared event"); Assert.IsTrue (_tableClearedEventFired, "#0 should have fired cleared event"); -#endif // NET_2_0 DataRow r = table.Rows.Find (1); Assert.IsTrue (r == null, "#1 should have cleared"); @@ -1490,7 +1467,6 @@ namespace MonoTests.System.Data Assert.AreEqual (1, table.Rows.Count, "#2 should add row"); } -#if NET_2_0 private bool _tableClearedEventFired; private void OnTableCleared (object src, DataTableClearEventArgs args) { @@ -1508,9 +1484,7 @@ namespace MonoTests.System.Data { _tableNewRowAddedEventFired = true; } -#endif // NET_2_0 -#if NET_2_0 [Test] public void TestWriteXmlSchema1 () { @@ -1852,7 +1826,6 @@ namespace MonoTests.System.Data Assert.AreEqual (" </xs:element>", substring, "test#32"); Assert.AreEqual ("</xs:schema>", TextString, "test#33"); } -#endif [Test] public void Serialize () @@ -2032,7 +2005,6 @@ namespace MonoTests.System.Data Assert.AreEqual (1, dt.Rows.Count); } -#if NET_2_0 private bool tableInitialized; [Test] public void TableInitializedEventTest1 () @@ -2093,7 +2065,6 @@ namespace MonoTests.System.Data { tableInitialized = true; } -#endif public void OnRowChanging (object src, DataRowChangeEventArgs args) { @@ -2105,7 +2076,6 @@ namespace MonoTests.System.Data rowActionChanged = args.Action; } -#if NET_2_0 private DataTable dt; private void localSetup () { dt = new DataTable ("test"); @@ -4160,7 +4130,6 @@ namespace MonoTests.System.Data #endregion // Read/Write XML Tests -#endif // NET_2_0 } public class MyDataTable : DataTable diff --git a/mcs/class/System.Data/Test/System.Data/ForeignKeyConstraintTest.cs b/mcs/class/System.Data/Test/System.Data/ForeignKeyConstraintTest.cs index 5e633630f99..8328f7ebbb2 100644 --- a/mcs/class/System.Data/Test/System.Data/ForeignKeyConstraintTest.cs +++ b/mcs/class/System.Data/Test/System.Data/ForeignKeyConstraintTest.cs @@ -209,15 +209,11 @@ namespace MonoTests.System.Data // Create a ForeingKeyConstraint Object using the constructor // ForeignKeyConstraint (string, string, string[], string[], AcceptRejectRule, Rule, Rule); ForeignKeyConstraint fkc = new ForeignKeyConstraint ("hello world", parentTableName, parentColumnNames, childColumnNames, AcceptRejectRule.Cascade, Rule.Cascade, Rule.Cascade); // Assert that the Constraint object does not belong to any table yet -#if NET_1_1 try { DataTable tmp = fkc.Table; Fail ("When table is null, get_Table causes an InvalidOperationException."); } catch (InvalidOperationException) { } -#else - Assertion.AssertEquals ("#A01 Table should not be set", fkc.Table, null); -#endif Constraint []constraints = new Constraint[3]; constraints [0] = new UniqueConstraint (column1); @@ -302,11 +298,7 @@ namespace MonoTests.System.Data fkc = new ForeignKeyConstraint((DataColumn)null,(DataColumn)null); Fail("Failed to throw ArgumentNullException."); } -#if NET_1_1 catch (NullReferenceException) {} -#else - catch (ArgumentNullException) {} -#endif catch (AssertionException exc) {throw exc;} catch (Exception exc) { @@ -344,13 +336,8 @@ namespace MonoTests.System.Data fkc = new ForeignKeyConstraint(_ds.Tables[0].Columns[0], localTable.Columns[1]); Fail("Failed to throw InvalidConstraintException."); } -#if NET_1_1 // tables in different datasets catch (InvalidOperationException) {} -#else - //different dataTypes - catch (InvalidConstraintException) {} -#endif // Cannot create a Key from Columns that belong to // different tables. |