diff options
author | Zoltan Varga <vargaz@gmail.com> | 2015-01-13 23:29:38 +0300 |
---|---|---|
committer | Zoltan Varga <vargaz@gmail.com> | 2015-01-13 23:29:38 +0300 |
commit | 0985d4aa4be4a9286db4e36cf75e3b18a31e5ff9 (patch) | |
tree | 46b65e83cd552237e592e85486afcca719d8a9c3 /mcs/class/Mono.Data.Tds | |
parent | f54652de26710952d4f80e25d87a87b346a86992 (diff) |
[bcl] Remove NET_2_0 defines from the class libs. This has been done using: unifdef -t -DNET_2_0 -o <filename> <filename>.
Diffstat (limited to 'mcs/class/Mono.Data.Tds')
12 files changed, 0 insertions, 175 deletions
diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs index f06932c8026..580c8dd85fa 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds.cs @@ -240,13 +240,9 @@ namespace Mono.Data.Tds.Protocol throw new Exception ("Cannot Skip to a colindex less than the curr index"); while (colIndex != StreamColumnIndex) { -#if NET_2_0 TdsColumnType? colType = Columns[StreamColumnIndex].ColumnType; if (colType == null) throw new Exception ("Column type unset."); -#else - TdsColumnType colType = (TdsColumnType) Columns [StreamColumnIndex]["ColumnType"]; -#endif if (!(colType == TdsColumnType.Image || colType == TdsColumnType.Text || colType == TdsColumnType.NText)) { @@ -273,11 +269,7 @@ namespace Mono.Data.Tds.Protocol if (colIndex != StreamColumnIndex) SkipToColumnIndex (colIndex); -#if NET_2_0 object o = GetColumnValue (Columns[colIndex].ColumnType, false, colIndex); -#else - object o = GetColumnValue ((TdsColumnType)Columns[colIndex]["ColumnType"], false, colIndex); -#endif StreamColumnIndex++; return o; } @@ -291,11 +283,7 @@ namespace Mono.Data.Tds.Protocol SkipToColumnIndex (colIndex); if (!LoadInProgress) { -#if NET_2_0 BeginLoad (Columns[colIndex].ColumnType); -#else - BeginLoad ((TdsColumnType)Columns[colIndex]["ColumnType"]); -#endif } if (buffer == null) @@ -308,11 +296,7 @@ namespace Mono.Data.Tds.Protocol } private void BeginLoad ( -#if NET_2_0 TdsColumnType? colType -#else - TdsColumnType colType -#endif ) { if (LoadInProgress) @@ -320,10 +304,8 @@ namespace Mono.Data.Tds.Protocol StreamLength = 0; -#if NET_2_0 if (colType == null) throw new ArgumentNullException ("colType"); -#endif switch (colType) { case TdsColumnType.Text : @@ -757,22 +739,14 @@ namespace Mono.Data.Tds.Protocol } protected object GetColumnValue ( -#if NET_2_0 TdsColumnType? colType, -#else - TdsColumnType colType, -#endif bool outParam) { return GetColumnValue (colType, outParam, -1); } private object GetColumnValue ( -#if NET_2_0 TdsColumnType? colType, -#else - TdsColumnType colType, -#endif bool outParam, int ordinal) { int len; @@ -780,18 +754,11 @@ namespace Mono.Data.Tds.Protocol Encoding enc = null; int lcid = 0, sortId = 0; -#if NET_2_0 if (colType == null) throw new ArgumentNullException ("colType"); -#endif if (ordinal > -1 && tdsVersion > TdsVersion.tds70) { -#if NET_2_0 lcid = (int) columns[ordinal].LCID; sortId = (int) columns[ordinal].SortOrder; -#else - lcid = (int) columns[ordinal]["LCID"]; - sortId = (int) columns[ordinal]["SortOrder"]; -#endif } switch (colType) { @@ -897,13 +864,8 @@ namespace Mono.Data.Tds.Protocol scale = comm.GetByte (); } else { -#if NET_2_0 precision = (byte) columns[ordinal].NumericPrecision; scale = (byte) columns[ordinal].NumericScale; -#else - precision = (byte) columns[ordinal]["NumericPrecision"]; - scale = (byte) columns[ordinal]["NumericScale"]; -#endif } element = GetDecimalValue (precision, scale); @@ -995,20 +957,14 @@ namespace Mono.Data.Tds.Protocol } private object GetDateTimeValue ( -#if NET_2_0 TdsColumnType? type -#else - TdsColumnType type -#endif ) { int len = 0; object result; -#if NET_2_0 if (type == null) throw new ArgumentNullException ("type"); -#endif switch (type) { case TdsColumnType.DateTime4: len = 4; @@ -1120,17 +1076,11 @@ namespace Mono.Data.Tds.Protocol } private object GetFloatValue ( -#if NET_2_0 TdsColumnType? columnType -#else - TdsColumnType columnType -#endif ) { -#if NET_2_0 if (columnType == null) throw new ArgumentNullException ("columnType"); -#endif int columnSize = 0; switch (columnType) { @@ -1172,19 +1122,13 @@ namespace Mono.Data.Tds.Protocol } private object GetIntValue ( -#if NET_2_0 TdsColumnType? type -#else - TdsColumnType type -#endif ) { int len; -#if NET_2_0 if (type == null) throw new ArgumentNullException ("type"); -#endif switch (type) { case TdsColumnType.BigInt : len = 8; @@ -1220,19 +1164,13 @@ namespace Mono.Data.Tds.Protocol } private object GetMoneyValue ( -#if NET_2_0 TdsColumnType? type -#else - TdsColumnType type -#endif ) { int len; -#if NET_2_0 if (type == null) throw new ArgumentNullException ("type"); -#endif switch (type) { case TdsColumnType.SmallMoney : case TdsColumnType.Money4 : @@ -1273,11 +1211,7 @@ namespace Mono.Data.Tds.Protocol } protected object GetStringValue ( -#if NET_2_0 TdsColumnType? colType, -#else - TdsColumnType colType, -#endif bool wideChars, bool outputParam, Encoding encoder) { bool shortLen = false; @@ -1416,11 +1350,7 @@ namespace Mono.Data.Tds.Protocol int i = 0; foreach (TdsDataColumn column in columns) { -#if NET_2_0 object o = GetColumnValue (column.ColumnType, false, i); -#else - object o = GetColumnValue ((TdsColumnType)column["ColumnType"], false, i); -#endif currentRow.Add (o); if (doneProc) outputParameters.Add (o); @@ -1514,21 +1444,12 @@ namespace Mono.Data.Tds.Protocol bool isExpression = ((values[2] & (byte) TdsColumnStatus.IsExpression) != 0); TdsDataColumn column = columns [index]; -#if NET_2_0 column.IsHidden = ((values[2] & (byte) TdsColumnStatus.Hidden) != 0); column.IsExpression = isExpression; column.IsKey = ((values[2] & (byte) TdsColumnStatus.IsKey) != 0); column.IsAliased = isAlias; column.BaseColumnName = ((isAlias) ? baseColumnName : null); column.BaseTableName = ((!isExpression) ? (string) tableNames [tableIndex] : null); -#else - column ["IsHidden"] = ((values [2] & (byte) TdsColumnStatus.Hidden) != 0); - column ["IsExpression"] = isExpression; - column ["IsKey"] = ((values [2] & (byte) TdsColumnStatus.IsKey) != 0); - column ["IsAliased"] = isAlias; - column ["BaseColumnName"] = ((isAlias) ? baseColumnName : null); - column ["BaseTableName"] = ((!isExpression) ? tableNames [tableIndex] : null); -#endif } } @@ -1937,7 +1858,6 @@ namespace Mono.Data.Tds.Protocol #endregion // Private Methods -#if NET_2_0 #region asynchronous methods protected IAsyncResult BeginExecuteQueryInternal (string sql, bool wantResults, AsyncCallback callback, object state) @@ -2048,7 +1968,6 @@ namespace Mono.Data.Tds.Protocol } #endregion // asynchronous methods -#endif // NET_2_0 } diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds42.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds42.cs index fb517d013d5..a457dc9099c 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds42.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds42.cs @@ -273,7 +273,6 @@ namespace Mono.Data.Tds.Protocol { TdsDataColumn col = new TdsDataColumn (); int index = Columns.Add (col); -#if NET_2_0 col.ColumnType = columnType; col.ColumnSize = bufLength; col.ColumnName = ColumnNames[index] as string; @@ -282,16 +281,6 @@ namespace Mono.Data.Tds.Protocol { col.IsReadOnly = !writable; col.BaseTableName = tableName; col.AllowDBNull = nullable; -#else - col["ColumnType"] = columnType; - col["ColumnSize"] = bufLength; - col["ColumnName"] = ColumnNames[index]; - col["NumericPrecision"] = precision; - col["NumericScale"] = scale; - col["IsReadOnly"] = !writable; - col["BaseTableName"] = tableName; - col["AllowDBNull"] = nullable; -#endif } } diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds50.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds50.cs index 88219125df5..29171dcbd64 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds50.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds50.cs @@ -508,7 +508,6 @@ namespace Mono.Data.Tds.Protocol TdsDataColumn col = new TdsDataColumn (); Columns.Add (col); -#if NET_2_0 col.ColumnType = columnType; col.ColumnName = columnName; col.IsIdentity = isIdentity; @@ -521,20 +520,6 @@ namespace Mono.Data.Tds.Protocol col.IsKey = isKey; col.AllowDBNull = allowDBNull; col.IsHidden = hidden; -#else - col ["ColumnType"] = columnType; - col ["ColumnName"] = columnName; - col ["IsIdentity"] = isIdentity; - col ["IsRowVersion"] = isRowVersion; - col ["ColumnType"] = columnType; - col ["ColumnSize"] = bufLength; - col ["NumericPrecision"] = precision; - col ["NumericScale"] = scale; - col ["IsReadOnly"] = !isUpdatable; - col ["IsKey"] = isKey; - col ["AllowDBNull"] = allowDBNull; - col ["IsHidden"] = hidden; -#endif } } diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs index 2f4fef03e19..f484b727fb5 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds70.cs @@ -693,11 +693,7 @@ namespace Mono.Data.Tds.Protocol CultureInfo.InvariantCulture, "Value '{0}' is not valid for SmallMoney." + " Must be between {1:N4} and {2:N4}.", -#if NET_2_0 val, -#else - val.ToString (CultureInfo.CurrentCulture), -#endif SMALLMONEY_MIN, SMALLMONEY_MAX)); int[] arr = Decimal.GetBits (val); @@ -886,7 +882,6 @@ namespace Mono.Data.Tds.Protocol TdsDataColumn col = new TdsDataColumn (); Columns.Add (col); -#if NET_2_0 col.ColumnType = columnType; col.ColumnName = columnName; col.IsAutoIncrement = autoIncrement; @@ -898,19 +893,6 @@ namespace Mono.Data.Tds.Protocol col.AllowDBNull = nullable; col.BaseTableName = tableName; col.DataTypeName = Enum.GetName (typeof (TdsColumnType), xColumnType); -#else - col ["ColumnType"] = columnType; - col ["ColumnName"] = columnName; - col ["IsAutoIncrement"] = autoIncrement; - col ["IsIdentity"] = isIdentity; - col ["ColumnSize"] = columnSize; - col ["NumericPrecision"] = precision; - col ["NumericScale"] = scale; - col ["IsReadOnly"] = !writable; - col ["AllowDBNull"] = nullable; - col ["BaseTableName"] = tableName; - col ["DataTypeName"] = Enum.GetName (typeof (TdsColumnType), xColumnType); -#endif } } @@ -1073,7 +1055,6 @@ namespace Mono.Data.Tds.Protocol #endregion // Methods -#if NET_2_0 #region Asynchronous Methods public override IAsyncResult BeginExecuteNonQuery (string cmdText, @@ -1136,6 +1117,5 @@ namespace Mono.Data.Tds.Protocol } #endregion // Asynchronous Methods -#endif // NET_2_0 } } diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs index 8d26453ecf6..cc5d2390ae5 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/Tds80.cs @@ -175,7 +175,6 @@ namespace Mono.Data.Tds.Protocol { TdsDataColumn col = new TdsDataColumn (); Columns.Add (col); -#if NET_2_0 col.ColumnType = columnType; col.ColumnName = columnName; col.IsAutoIncrement = autoIncrement; @@ -188,20 +187,6 @@ namespace Mono.Data.Tds.Protocol { col.BaseTableName = tableName; col.LCID = lcid; col.SortOrder = sortId; -#else - col ["ColumnType"] = columnType; - col ["ColumnName"] = columnName; - col ["IsAutoIncrement"] = autoIncrement; - col ["IsIdentity"] = isIdentity; - col ["ColumnSize"] = columnSize; - col ["NumericPrecision"] = precision; - col ["NumericScale"] = scale; - col ["IsReadOnly"] = !writable; - col ["AllowDBNull"] = nullable; - col ["BaseTableName"] = tableName; - col ["LCID"] = lcid; - col ["SortOrder"] = sortId; -#endif } //Console.WriteLine ("Tds80.cs: In ProcessColumnInfo... exit"); TDS 8 Debugging } diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsAsyncResult.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsAsyncResult.cs index 8e6041f2048..f110c6edc60 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsAsyncResult.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsAsyncResult.cs @@ -30,7 +30,6 @@ // -#if NET_2_0 using System; using System.Threading; @@ -125,4 +124,3 @@ namespace Mono.Data.Tds.Protocol } } -#endif // NET_2_0 diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsAsyncState.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsAsyncState.cs index db7b00d3666..dfc57a752da 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsAsyncState.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsAsyncState.cs @@ -30,7 +30,6 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if NET_2_0 using System; using System.Net.Sockets; @@ -60,4 +59,3 @@ namespace Mono.Data.Tds.Protocol { } } -#endif // NET_2_0 diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsBulkCopy.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsBulkCopy.cs index e7360d0a0d0..1e20ec03aec 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsBulkCopy.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsBulkCopy.cs @@ -26,7 +26,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; namespace Mono.Data.Tds.Protocol { @@ -220,4 +219,3 @@ namespace Mono.Data.Tds.Protocol { #endregion } } -#endif diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs index c44f8d51d73..af8d3904452 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsComm.cs @@ -93,7 +93,6 @@ namespace Mono.Data.Tds.Protocol { bool have_exception = false; try { -#if NET_2_0 IPAddress ip; if(IPAddress.TryParse(this.dataSource, out ip)) { endPoint = new IPEndPoint(ip, port); @@ -101,10 +100,6 @@ namespace Mono.Data.Tds.Protocol { IPHostEntry hostEntry = Dns.GetHostEntry (this.dataSource); endPoint = new IPEndPoint(hostEntry.AddressList [0], port); } -#else - IPHostEntry hostEntry = Dns.Resolve (this.dataSource); - endPoint = new IPEndPoint (hostEntry.AddressList [0], port); -#endif } catch (SocketException e) { throw new TdsInternalException ("Server does not exist or connection refused.", e); } @@ -125,9 +120,7 @@ namespace Mono.Data.Tds.Protocol { } try { -#if NET_2_0 socket.NoDelay = true; -#endif socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.SendTimeout, timeout_ms); socket.SetSocketOption (SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, timeout_ms); } catch { @@ -848,7 +841,6 @@ namespace Mono.Data.Tds.Protocol { } #endregion // Methods -#if NET_2_0 #region Async Methods public IAsyncResult BeginReadPacket (AsyncCallback callback, object stateObject) @@ -907,7 +899,6 @@ namespace Mono.Data.Tds.Protocol { } #endregion // Async Methods -#endif // NET_2_0 } diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs index 7ec2fe0e9e2..649d8000c30 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsConnectionPool.cs @@ -262,7 +262,6 @@ retry: } } -#if NET_2_0 public void ResetConnectionPool () { lock (available) { @@ -284,7 +283,6 @@ retry: Monitor.PulseAll (available); } } -#endif #endregion // Methods } } diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumn.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumn.cs index a575015409f..99f5b523871 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumn.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumn.cs @@ -38,25 +38,14 @@ namespace Mono.Data.Tds.Protocol { public TdsDataColumn () { -#if NET_2_0 IsAutoIncrement = false; IsIdentity = false; IsRowVersion = false; IsUnique = false; IsHidden = false; -#else - object bool_false = false; - - this ["IsAutoIncrement"] = bool_false; - this ["IsIdentity"] = bool_false; - this ["IsRowVersion"] = bool_false; - this ["IsUnique"] = bool_false; - this ["IsHidden"] = bool_false; -#endif } -#if NET_2_0 public TdsColumnType? ColumnType { get; set; @@ -176,7 +165,6 @@ namespace Mono.Data.Tds.Protocol { get; set; } -#endif // This allows the storage of arbitrary properties in addition to the predefined ones public object this [string key] { diff --git a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumnCollection.cs b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumnCollection.cs index f269d39b988..5b32802c876 100644 --- a/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumnCollection.cs +++ b/mcs/class/Mono.Data.Tds/Mono.Data.Tds.Protocol/TdsDataColumnCollection.cs @@ -68,11 +68,7 @@ namespace Mono.Data.Tds.Protocol { { int index; index = list.Add (schema); -#if NET_2_0 schema.ColumnOrdinal = index; -#else - schema["ColumnOrdinal"] = index; -#endif return index; } |