diff --git a/crypto/crypto.csproj b/crypto/crypto.csproj
index cdb48bfff..a1e217aca 100644
--- a/crypto/crypto.csproj
+++ b/crypto/crypto.csproj
@@ -6769,6 +6769,11 @@
BuildAction = "Compile"
/>
<File
+ RelPath = "src\util\TypeExtensions.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "src\util\collections\CollectionUtilities.cs"
SubType = "Code"
BuildAction = "Compile"
diff --git a/crypto/src/asn1/DerGeneralizedTime.cs b/crypto/src/asn1/DerGeneralizedTime.cs
index 40ec17b2a..17c42e7cf 100644
--- a/crypto/src/asn1/DerGeneralizedTime.cs
+++ b/crypto/src/asn1/DerGeneralizedTime.cs
@@ -83,7 +83,11 @@ namespace Org.BouncyCastle.Asn1
public DerGeneralizedTime(
DateTime time)
{
+#if PORTABLE
this.time = time.ToUniversalTime().ToString(@"yyyyMMddHHmmss\Z");
+#else
+ this.time = time.ToString(@"yyyyMMddHHmmss\Z");
+#endif
}
internal DerGeneralizedTime(
diff --git a/crypto/src/asn1/DerUTCTime.cs b/crypto/src/asn1/DerUTCTime.cs
index ebf57198f..4f0792636 100644
--- a/crypto/src/asn1/DerUTCTime.cs
+++ b/crypto/src/asn1/DerUTCTime.cs
@@ -86,7 +86,11 @@ namespace Org.BouncyCastle.Asn1
public DerUtcTime(
DateTime time)
{
+#if PORTABLE
this.time = time.ToUniversalTime().ToString("yyMMddHHmmss", CultureInfo.InvariantCulture) + "Z";
+#else
+ this.time = time.ToString("yyMMddHHmmss", CultureInfo.InvariantCulture) + "Z";
+#endif
}
internal DerUtcTime(
diff --git a/crypto/src/asn1/x509/Time.cs b/crypto/src/asn1/x509/Time.cs
index 770d59d46..ffe293521 100644
--- a/crypto/src/asn1/x509/Time.cs
+++ b/crypto/src/asn1/x509/Time.cs
@@ -34,7 +34,11 @@ namespace Org.BouncyCastle.Asn1.X509
public Time(
DateTime date)
{
+#if PORTABLE
string d = date.ToUniversalTime().ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture) + "Z";
+#else
+ string d = date.ToString("yyyyMMddHHmmss", CultureInfo.InvariantCulture) + "Z";
+#endif
int year = int.Parse(d.Substring(0, 4));
diff --git a/crypto/src/util/Enums.cs b/crypto/src/util/Enums.cs
index 20b978c22..660bbe73f 100644
--- a/crypto/src/util/Enums.cs
+++ b/crypto/src/util/Enums.cs
@@ -44,13 +44,13 @@ namespace Org.BouncyCastle.Utilities
internal static Array GetEnumValues(System.Type enumType)
{
#if NEW_REFLECTION
- if(!enumType.GetTypeInfo().IsEnum)
+ if (!enumType.GetTypeInfo().IsEnum)
#else
if (!enumType.IsEnum)
#endif
throw new ArgumentException("Not an enumeration type", "enumType");
-#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT && !PORTABLE
+#if NETCF_1_0 || NETCF_2_0 || SILVERLIGHT
IList result = Platform.CreateArrayList();
FieldInfo[] fields = enumType.GetFields(BindingFlags.Static | BindingFlags.Public);
foreach (FieldInfo field in fields)
diff --git a/crypto/src/util/TypeExtensions.cs b/crypto/src/util/TypeExtensions.cs
index c7ce807a0..e2aeae4dc 100644
--- a/crypto/src/util/TypeExtensions.cs
+++ b/crypto/src/util/TypeExtensions.cs
@@ -1,8 +1,8 @@
+#if NEW_REFLECTION
+
using System;
using System.Reflection;
-#if NEW_REFLECTION
-
namespace Org.BouncyCastle
{
internal static class TypeExtensions
@@ -12,7 +12,6 @@ namespace Org.BouncyCastle
return instance != null && type.GetTypeInfo().IsAssignableFrom(instance.GetType().GetTypeInfo());
}
}
-
}
-#endif
\ No newline at end of file
+#endif
diff --git a/crypto/test/src/util/test/SimpleTest.cs b/crypto/test/src/util/test/SimpleTest.cs
index d759674ea..faeee65c9 100644
--- a/crypto/test/src/util/test/SimpleTest.cs
+++ b/crypto/test/src/util/test/SimpleTest.cs
@@ -115,22 +115,20 @@ namespace Org.BouncyCastle.Utilities.Test
private static string GetFullName(
string name)
{
-// TODO MonoDevelop/Visual Studio embedded resource ids still inconsistent
-#if BC_BUILD_MONODEVELOP
- return "test.data." + name;
-#else
+#if PORTABLE
return "crypto.tests." + name;
+#else
+ return "crypto.test.data." + name;
#endif
}
private static string GetShortName(
string fullName)
{
-// TODO MonoDevelop/Visual Studio embedded resource ids still inconsistent
-#if BC_BUILD_MONODEVELOP
- return fullName.Substring("test.data.".Length);
-#else
+#if PORTABLE
return fullName.Substring("crypto.tests.".Length);
+#else
+ return fullName.Substring("crypto.test.data.".Length);
#endif
}
|