All methods in the StringHelper class are now extension methods in .NET 4.0 builds

git-svn-id: file:///srv/devel/repo-conversion/nusu@206 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
Markus Ewald 2010-10-10 10:47:37 +00:00
parent 8c63901338
commit f304f8c783
3 changed files with 28 additions and 4 deletions

View File

@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\net-2.0\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;UNITTEST;USE_XMLDOCUMENT</DefineConstants>
<DefineConstants>TRACE;DEBUG;UNITTEST;USE_XMLDOCUMENT;NO_EXTENSION_METHODS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\net-2.0\Debug\Nuclex.Support.xml</DocumentationFile>
@ -27,7 +27,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\net-2.0\Release\</OutputPath>
<DefineConstants>TRACE;UNITTEST;USE_XMLDOCUMENT</DefineConstants>
<DefineConstants>TRACE;UNITTEST;USE_XMLDOCUMENT;NO_EXTENSION_METHODS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\net-2.0\Release\Nuclex.Support.xml</DocumentationFile>

View File

@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\xna-3.1-xbox360\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;XBOX;XBOX360;USE_XMLDOCUMENT;NO_SERIALIZATION;NO_SYSTEMEVENTS;XNA_3</DefineConstants>
<DefineConstants>TRACE;DEBUG;XBOX;XBOX360;USE_XMLDOCUMENT;NO_SERIALIZATION;NO_SYSTEMEVENTS;XNA_3;NO_EXTENSION_METHODS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>
@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\xna-3.1-xbox360\Release\</OutputPath>
<DefineConstants>TRACE;XBOX;XBOX360;USE_XMLDOCUMENT;NO_SERIALIZATION;NO_SYSTEMEVENTS;XNA_3</DefineConstants>
<DefineConstants>TRACE;XBOX;XBOX360;USE_XMLDOCUMENT;NO_SERIALIZATION;NO_SYSTEMEVENTS;XNA_3;NO_EXTENSION_METHODS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoStdLib>true</NoStdLib>

View File

@ -37,7 +37,11 @@ namespace Nuclex.Support {
/// <paramref name="anyNotOf" /> array or -1 if all characters in the string were
/// present in the <paramref name="anyNotOf" /> array.
/// </returns>
#if NO_EXTENSION_METHODS
public static int IndexNotOfAny(string haystack, char[] anyNotOf) {
#else
public static int IndexNotOfAny(this string haystack, char[] anyNotOf) {
#endif
return IndexNotOfAny(haystack, anyNotOf, 0, haystack.Length);
}
@ -55,7 +59,11 @@ namespace Nuclex.Support {
/// <paramref name="anyNotOf" /> array or -1 if all characters in the string were
/// present in the <paramref name="anyNotOf" /> array.
/// </returns>
#if NO_EXTENSION_METHODS
public static int IndexNotOfAny(string haystack, char[] anyNotOf, int startIndex) {
#else
public static int IndexNotOfAny(this string haystack, char[] anyNotOf, int startIndex) {
#endif
return IndexNotOfAny(haystack, anyNotOf, startIndex, haystack.Length - startIndex);
}
@ -75,7 +83,11 @@ namespace Nuclex.Support {
/// present in the <paramref name="anyNotOf" /> array.
/// </returns>
public static int IndexNotOfAny(
#if NO_EXTENSION_METHODS
string haystack, char[] anyNotOf, int startIndex, int count
#else
this string haystack, char[] anyNotOf, int startIndex, int count
#endif
) {
int anyLength = anyNotOf.Length;
@ -105,7 +117,11 @@ namespace Nuclex.Support {
/// <paramref name="anyNotOf" /> array or -1 if all characters in the string were
/// present in the <paramref name="anyNotOf" /> array.
/// </returns>
#if NO_EXTENSION_METHODS
public static int LastIndexNotOfAny(string haystack, char[] anyNotOf) {
#else
public static int LastIndexNotOfAny(this string haystack, char[] anyNotOf) {
#endif
return LastIndexNotOfAny(haystack, anyNotOf, haystack.Length - 1, haystack.Length);
}
@ -123,7 +139,11 @@ namespace Nuclex.Support {
/// <paramref name="anyNotOf" /> array or -1 if all characters in the string were
/// present in the <paramref name="anyNotOf" /> array.
/// </returns>
#if NO_EXTENSION_METHODS
public static int LastIndexNotOfAny(string haystack, char[] anyNotOf, int startIndex) {
#else
public static int LastIndexNotOfAny(this string haystack, char[] anyNotOf, int startIndex) {
#endif
return LastIndexNotOfAny(haystack, anyNotOf, startIndex, startIndex + 1);
}
@ -143,7 +163,11 @@ namespace Nuclex.Support {
/// present in the <paramref name="anyNotOf" /> array.
/// </returns>
public static int LastIndexNotOfAny(
#if NO_EXTENSION_METHODS
string haystack, char[] anyNotOf, int startIndex, int count
#else
this string haystack, char[] anyNotOf, int startIndex, int count
#endif
) {
int anyLength = anyNotOf.Length;