@@ -361,13 +361,6 @@ internal static InvalidOperationException MethodCalledTwice(string method)
361361 return e ;
362362 }
363363
364- internal static ArgumentOutOfRangeException ArgumentOutOfRange ( string message , string parameterName , object value )
365- {
366- ArgumentOutOfRangeException e = new ( parameterName , value , message ) ;
367- TraceExceptionAsReturnValue ( e ) ;
368- return e ;
369- }
370-
371364 internal static AuthenticationException SSLCertificateAuthenticationException ( string message )
372365 {
373366 AuthenticationException e = new ( message ) ;
@@ -457,9 +450,6 @@ internal static ArgumentOutOfRangeException InvalidUserDefinedTypeSerializationF
457450 return InvalidEnumerationValue ( typeof ( Format ) , ( int ) value ) ;
458451 }
459452
460- internal static ArgumentOutOfRangeException NotSupportedUserDefinedTypeSerializationFormat ( Format value , string method )
461- => NotSupportedEnumerationValue ( typeof ( Format ) , value . ToString ( ) , method ) ;
462-
463453 internal static ArgumentException InvalidArgumentLength ( string argumentName , int limit )
464454 => Argument ( StringsHelper . GetString ( Strings . ADP_InvalidArgumentLength , argumentName , limit ) ) ;
465455
@@ -1079,9 +1069,6 @@ internal static Exception InvalidDataLength(long length)
10791069 internal static bool CompareInsensitiveInvariant ( string strvalue , string strconst )
10801070 => 0 == CultureInfo . InvariantCulture . CompareInfo . Compare ( strvalue , strconst , CompareOptions . IgnoreCase ) ;
10811071
1082- internal static int DstCompare ( string strA , string strB ) // this is null safe
1083- => CultureInfo . CurrentCulture . CompareInfo . Compare ( strA , strB , ADP . DefaultCompareOptions ) ;
1084-
10851072 internal static void SetCurrentTransaction ( Transaction transaction ) => Transaction . Current = transaction ;
10861073
10871074 internal static Exception NonSeqByteAccess ( long badIndex , long currIndex , string method )
@@ -1237,11 +1224,6 @@ internal static Exception UndefinedCollection(string collectionName)
12371224 internal static Exception AmbiguousCollectionName ( string collectionName )
12381225 => Argument ( StringsHelper . GetString ( Strings . MDF_AmbiguousCollectionName , collectionName ) ) ;
12391226
1240- internal static Exception MissingDataSourceInformationColumn ( ) => Argument ( StringsHelper . GetString ( Strings . MDF_MissingDataSourceInformationColumn ) ) ;
1241-
1242- internal static Exception IncorrectNumberOfDataSourceInformationRows ( )
1243- => Argument ( StringsHelper . GetString ( Strings . MDF_IncorrectNumberOfDataSourceInformationRows ) ) ;
1244-
12451227 internal static Exception MissingRestrictionColumn ( ) => Argument ( StringsHelper . GetString ( Strings . MDF_MissingRestrictionColumn ) ) ;
12461228
12471229 internal static Exception MissingRestrictionRow ( ) => Argument ( StringsHelper . GetString ( Strings . MDF_MissingRestrictionRow ) ) ;
@@ -1398,13 +1380,6 @@ internal static Exception InvalidMixedUsageOfAccessTokenCallbackAndIntegratedSec
13981380 internal static readonly IntPtr s_ptrZero = IntPtr . Zero ;
13991381#if NETFRAMEWORK
14001382#region netfx project only
1401- internal static Task < T > CreatedTaskWithException < T > ( Exception ex )
1402- {
1403- TaskCompletionSource < T > completion = new ( ) ;
1404- completion . SetException ( ex ) ;
1405- return completion . Task ;
1406- }
1407-
14081383 //
14091384 // Helper Functions
14101385 //
@@ -1501,14 +1476,6 @@ internal static Exception PermissionTypeMismatch()
15011476 return Argument ( StringsHelper . GetString ( Strings . ADP_PermissionTypeMismatch ) ) ;
15021477 }
15031478
1504- //
1505- // DbDataReader
1506- //
1507- internal static Exception NumericToDecimalOverflow ( )
1508- {
1509- return InvalidCast ( StringsHelper . GetString ( Strings . ADP_NumericToDecimalOverflow ) ) ;
1510- }
1511-
15121479 //
15131480 // DbDataAdapter
15141481 //
@@ -1526,79 +1493,12 @@ internal static InvalidOperationException ComputerNameEx(int lastError)
15261493 internal const float FailoverTimeoutStepForTnir = 0.125F ; // Fraction of timeout to use in case of Transparent Network IP resolution.
15271494 internal const int MinimumTimeoutForTnirMs = 500 ; // The first login attempt in Transparent network IP Resolution
15281495
1529- internal static readonly int s_ptrSize = IntPtr . Size ;
1530- internal static readonly IntPtr s_invalidPtr = new ( - 1 ) ; // use for INVALID_HANDLE
1531-
15321496 internal static readonly bool s_isWindowsNT = ( PlatformID . Win32NT == Environment . OSVersion . Platform ) ;
1533- internal static readonly bool s_isPlatformNT5 = ( ADP . s_isWindowsNT && ( Environment . OSVersion . Version . Major >= 5 ) ) ;
1534-
1535- [ FileIOPermission ( SecurityAction . Assert , AllFiles = FileIOPermissionAccess . PathDiscovery ) ]
1536- [ ResourceExposure ( ResourceScope . Machine ) ]
1537- [ ResourceConsumption ( ResourceScope . Machine ) ]
1538- internal static string GetFullPath ( string filename )
1539- { // MDAC 77686
1540- return Path . GetFullPath ( filename ) ;
1541- }
1542-
1543- // TODO: cache machine name and listen to longhorn event to reset it
1544- internal static string GetComputerNameDnsFullyQualified ( )
1545- {
1546- const int ComputerNameDnsFullyQualified = 3 ; // winbase.h, enum COMPUTER_NAME_FORMAT
1547- const int ERROR_MORE_DATA = 234 ; // winerror.h
1548-
1549- string value ;
1550- if ( s_isPlatformNT5 )
1551- {
1552- int length = 0 ; // length parameter must be zero if buffer is null
1553- // query for the required length
1554- // VSTFDEVDIV 479551 - ensure that GetComputerNameEx does not fail with unexpected values and that the length is positive
1555- int getComputerNameExError = 0 ;
1556- if ( 0 == Kernel32Safe . GetComputerNameEx ( ComputerNameDnsFullyQualified , null , ref length ) )
1557- {
1558- getComputerNameExError = Marshal . GetLastWin32Error ( ) ;
1559- }
1560- if ( ( getComputerNameExError != 0 && getComputerNameExError != ERROR_MORE_DATA ) || length <= 0 )
1561- {
1562- throw ADP . ComputerNameEx ( getComputerNameExError ) ;
1563- }
1564-
1565- StringBuilder buffer = new ( length ) ;
1566- length = buffer . Capacity ;
1567- if ( 0 == Kernel32Safe . GetComputerNameEx ( ComputerNameDnsFullyQualified , buffer , ref length ) )
1568- {
1569- throw ADP . ComputerNameEx ( Marshal . GetLastWin32Error ( ) ) ;
1570- }
1571-
1572- // Note: In Longhorn you'll be able to rename a machine without
1573- // rebooting. Therefore, don't cache this machine name.
1574- value = buffer . ToString ( ) ;
1575- }
1576- else
1577- {
1578- value = ADP . MachineName ( ) ;
1579- }
1580- return value ;
1581- }
1582-
1583- internal static IntPtr IntPtrOffset ( IntPtr pbase , int offset )
1584- {
1585- if ( 4 == ADP . s_ptrSize )
1586- {
1587- return ( IntPtr ) checked ( pbase . ToInt32 ( ) + offset ) ;
1588- }
1589- Debug . Assert ( 8 == ADP . s_ptrSize , "8 != IntPtr.Size" ) ; // MDAC 73747
1590- return ( IntPtr ) checked ( pbase . ToInt64 ( ) + offset ) ;
1591- }
15921497
15931498#endregion
15941499#else
15951500#region netcore project only
15961501
1597- //
1598- // COM+ exceptions
1599- //
1600- internal static PlatformNotSupportedException DbTypeNotSupported ( string dbType ) => new ( StringsHelper . GetString ( Strings . SQL_DbTypeNotSupportedOnThisPlatform , dbType ) ) ;
1601-
16021502 // IDbConnection.BeginTransaction, OleDbTransaction.Begin
16031503 internal static ArgumentOutOfRangeException InvalidIsolationLevel ( IsolationLevel value )
16041504 {
0 commit comments