Removed the last traces of Windows Phone 7 and Xbox 360 support
git-svn-id: file:///srv/devel/repo-conversion/nusu@314 d2e56fa2-650e-0410-a79f-9358c0239efd
This commit is contained in:
parent
9a4a051100
commit
b1b1f02e6f
5 changed files with 6 additions and 816 deletions
|
@ -51,20 +51,6 @@ namespace Nuclex.Support {
|
|||
|
||||
#endregion // enum EmptyEnumeration
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that the enum helper can list the members of an enumeration
|
||||
/// manually (as it needs to be done on the XBox 360)
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestGetValuesXbox360() {
|
||||
CollectionAssert.AreEquivalent(
|
||||
new TestEnumeration[] {
|
||||
TestEnumeration.One, TestEnumeration.Two, TestEnumeration.Three
|
||||
},
|
||||
EnumHelper.GetValuesXbox360<TestEnumeration>()
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies that the enum helper can list the members of an enumeration
|
||||
/// </summary>
|
||||
|
@ -98,17 +84,6 @@ namespace Nuclex.Support {
|
|||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests whether an exception is thrown if the GetValuesXbox360() method is
|
||||
/// used on a non-enumeration type
|
||||
/// </summary>
|
||||
[Test]
|
||||
public void TestThrowOnNonEnumTypeXbox360() {
|
||||
Assert.Throws<ArgumentException>(
|
||||
delegate() { EnumHelper.GetValuesXbox360<int>(); }
|
||||
);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests whether an exception is thrown if the GetValues() method is used on
|
||||
/// a non-enumeration type
|
||||
|
|
|
@ -92,39 +92,7 @@ namespace Nuclex.Support {
|
|||
/// and cache the result.
|
||||
/// </remarks>
|
||||
public static TEnum[] GetValues<TEnum>() {
|
||||
#if XBOX360 || WINDOWS_PHONE
|
||||
return GetValuesXbox360<TEnum>();
|
||||
#else
|
||||
return (TEnum[])Enum.GetValues(typeof(TEnum));
|
||||
#endif
|
||||
}
|
||||
|
||||
/// <summary>Retrieves a list of all values contained in an enumeration</summary>
|
||||
/// <typeparam name="TEnum">
|
||||
/// Type of the enumeration whose values will be returned
|
||||
/// </typeparam>
|
||||
/// <returns>All values contained in the specified enumeration</returns>
|
||||
internal static TEnum[] GetValuesXbox360<TEnum>() {
|
||||
Type enumType = typeof(TEnum);
|
||||
if(!enumType.IsEnum) {
|
||||
throw new ArgumentException(
|
||||
"The provided type needs to be an enumeration", "EnumType"
|
||||
);
|
||||
}
|
||||
|
||||
// Use reflection to get all fields in the enumeration
|
||||
FieldInfo[] fieldInfos = enumType.GetFields(
|
||||
BindingFlags.Public | BindingFlags.Static
|
||||
);
|
||||
|
||||
// Create an array to hold the enumeration values and copy them over from
|
||||
// the fields we just retrieved
|
||||
TEnum[] values = new TEnum[fieldInfos.Length];
|
||||
for(int index = 0; index < fieldInfos.Length; ++index) {
|
||||
values[index] = (TEnum)fieldInfos[index].GetValue(null);
|
||||
}
|
||||
|
||||
return values;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -18,6 +18,8 @@ License along with this library
|
|||
*/
|
||||
#endregion
|
||||
|
||||
#if WINDOWS
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
@ -26,6 +28,8 @@ namespace Nuclex.Support.Settings {
|
|||
/// <summary>Stores settings in the registry on Windows operating systems</summary>
|
||||
public class WindowsRegistryStore : ISettingsStore, IDisposable {
|
||||
|
||||
|
||||
|
||||
/// <summary>Immediately releases all resources owned by the instance</summary>
|
||||
public void Dispose() {
|
||||
}
|
||||
|
@ -99,3 +103,5 @@ namespace Nuclex.Support.Settings {
|
|||
}
|
||||
|
||||
} // namespace Nuclex.Support.Settings
|
||||
|
||||
#endif // WINDOWS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue