diff --git a/YamlDotNet.sln b/YamlDotNet.sln
index df0a392c1..2b3293a91 100644
--- a/YamlDotNet.sln
+++ b/YamlDotNet.sln
@@ -1,7 +1,7 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
-VisualStudioVersion = 12.0.30723.0
+VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{69EE9636-55BA-49C2-827E-D5684221C345}"
ProjectSection(SolutionItems) = preProject
@@ -34,15 +34,19 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug-UnitySubset-v35|Any CPU = Debug-UnitySubset-v35|Any CPU
PerformanceTests|Any CPU = PerformanceTests|Any CPU
Release-Portable-Signed|Any CPU = Release-Portable-Signed|Any CPU
Release-Portable-Unsigned|Any CPU = Release-Portable-Unsigned|Any CPU
Release-Signed|Any CPU = Release-Signed|Any CPU
+ Release-UnitySubset-v35|Any CPU = Release-UnitySubset-v35|Any CPU
Release-Unsigned|Any CPU = Release-Unsigned|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Debug-UnitySubset-v35|Any CPU.ActiveCfg = Debug-UnitySubset-v35|Any CPU
+ {BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Debug-UnitySubset-v35|Any CPU.Build.0 = Debug-UnitySubset-v35|Any CPU
{BF32DE1B-6276-4341-B212-F8862ADBBA7A}.PerformanceTests|Any CPU.ActiveCfg = Release-Portable-Unsigned|Any CPU
{BF32DE1B-6276-4341-B212-F8862ADBBA7A}.PerformanceTests|Any CPU.Build.0 = Release-Portable-Unsigned|Any CPU
{BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Release-Portable-Signed|Any CPU.ActiveCfg = Release-Portable-Signed|Any CPU
@@ -51,58 +55,74 @@ Global
{BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Release-Portable-Unsigned|Any CPU.Build.0 = Release-Portable-Unsigned|Any CPU
{BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Release-Signed|Any CPU.ActiveCfg = Release-Signed|Any CPU
{BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Release-Signed|Any CPU.Build.0 = Release-Signed|Any CPU
+ {BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Release-UnitySubset-v35|Any CPU.ActiveCfg = Release-UnitySubset-v35|Any CPU
+ {BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Release-UnitySubset-v35|Any CPU.Build.0 = Release-UnitySubset-v35|Any CPU
{BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Release-Unsigned|Any CPU.ActiveCfg = Release-Unsigned|Any CPU
{BF32DE1B-6276-4341-B212-F8862ADBBA7A}.Release-Unsigned|Any CPU.Build.0 = Release-Unsigned|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Debug-UnitySubset-v35|Any CPU.ActiveCfg = Debug|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.PerformanceTests|Any CPU.ActiveCfg = Release|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release-Portable-Signed|Any CPU.ActiveCfg = Release-Portable|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release-Portable-Unsigned|Any CPU.ActiveCfg = Release-Portable|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release-Portable-Unsigned|Any CPU.Build.0 = Release-Portable|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU
+ {A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release-UnitySubset-v35|Any CPU.ActiveCfg = Release|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{A9F67018-0240-4D16-A4EA-BCB780D0AF05}.Release-Unsigned|Any CPU.Build.0 = Release|Any CPU
{773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Debug-UnitySubset-v35|Any CPU.ActiveCfg = Debug|Any CPU
{773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.PerformanceTests|Any CPU.ActiveCfg = Release|Any CPU
{773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.PerformanceTests|Any CPU.Build.0 = Release|Any CPU
{773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Release-Portable-Signed|Any CPU.ActiveCfg = Release|Any CPU
{773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Release-Portable-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU
+ {773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Release-UnitySubset-v35|Any CPU.ActiveCfg = Release|Any CPU
{773B71D6-FEE5-4E4D-8717-5C5EF58D6F17}.Release-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Debug-UnitySubset-v35|Any CPU.ActiveCfg = Debug|Any CPU
{A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.PerformanceTests|Any CPU.ActiveCfg = Release|Any CPU
{A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.PerformanceTests|Any CPU.Build.0 = Release|Any CPU
{A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Release-Portable-Signed|Any CPU.ActiveCfg = Release|Any CPU
{A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Release-Portable-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU
+ {A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Release-UnitySubset-v35|Any CPU.ActiveCfg = Release|Any CPU
{A5C7D77C-0F08-4647-8376-3719BD6DEBD9}.Release-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{0FB497EA-A116-406A-AE8C-A24933D8CB21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0FB497EA-A116-406A-AE8C-A24933D8CB21}.Debug-UnitySubset-v35|Any CPU.ActiveCfg = Debug|Any CPU
{0FB497EA-A116-406A-AE8C-A24933D8CB21}.PerformanceTests|Any CPU.ActiveCfg = Release|Any CPU
{0FB497EA-A116-406A-AE8C-A24933D8CB21}.PerformanceTests|Any CPU.Build.0 = Release|Any CPU
{0FB497EA-A116-406A-AE8C-A24933D8CB21}.Release-Portable-Signed|Any CPU.ActiveCfg = Release|Any CPU
{0FB497EA-A116-406A-AE8C-A24933D8CB21}.Release-Portable-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{0FB497EA-A116-406A-AE8C-A24933D8CB21}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU
+ {0FB497EA-A116-406A-AE8C-A24933D8CB21}.Release-UnitySubset-v35|Any CPU.ActiveCfg = Release|Any CPU
{0FB497EA-A116-406A-AE8C-A24933D8CB21}.Release-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Debug-UnitySubset-v35|Any CPU.ActiveCfg = Debug|Any CPU
{C6E0B465-8422-4D6B-85CE-C59724A28E1F}.PerformanceTests|Any CPU.ActiveCfg = Release|Any CPU
{C6E0B465-8422-4D6B-85CE-C59724A28E1F}.PerformanceTests|Any CPU.Build.0 = Release|Any CPU
{C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Release-Portable-Signed|Any CPU.ActiveCfg = Release|Any CPU
{C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Release-Portable-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU
+ {C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Release-UnitySubset-v35|Any CPU.ActiveCfg = Release|Any CPU
{C6E0B465-8422-4D6B-85CE-C59724A28E1F}.Release-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{BE49A287-5F47-4E3B-90EB-97B51451934C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {BE49A287-5F47-4E3B-90EB-97B51451934C}.Debug-UnitySubset-v35|Any CPU.ActiveCfg = Debug|Any CPU
{BE49A287-5F47-4E3B-90EB-97B51451934C}.PerformanceTests|Any CPU.ActiveCfg = Release|Any CPU
{BE49A287-5F47-4E3B-90EB-97B51451934C}.PerformanceTests|Any CPU.Build.0 = Release|Any CPU
{BE49A287-5F47-4E3B-90EB-97B51451934C}.Release-Portable-Signed|Any CPU.ActiveCfg = Release|Any CPU
{BE49A287-5F47-4E3B-90EB-97B51451934C}.Release-Portable-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{BE49A287-5F47-4E3B-90EB-97B51451934C}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU
+ {BE49A287-5F47-4E3B-90EB-97B51451934C}.Release-UnitySubset-v35|Any CPU.ActiveCfg = Release|Any CPU
{BE49A287-5F47-4E3B-90EB-97B51451934C}.Release-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Debug-UnitySubset-v35|Any CPU.ActiveCfg = Debug|Any CPU
{91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.PerformanceTests|Any CPU.ActiveCfg = Release|Any CPU
{91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.PerformanceTests|Any CPU.Build.0 = Release|Any CPU
{91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Release-Portable-Signed|Any CPU.ActiveCfg = Release|Any CPU
{91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Release-Portable-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
{91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Release-Signed|Any CPU.ActiveCfg = Release|Any CPU
+ {91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Release-UnitySubset-v35|Any CPU.ActiveCfg = Release|Any CPU
{91A1F4BC-65C0-42E6-B5FD-320A2D59AF71}.Release-Unsigned|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
diff --git a/YamlDotNet/Core/AnchorNotFoundException.cs b/YamlDotNet/Core/AnchorNotFoundException.cs
index e9c52548a..d29b37475 100644
--- a/YamlDotNet/Core/AnchorNotFoundException.cs
+++ b/YamlDotNet/Core/AnchorNotFoundException.cs
@@ -64,7 +64,7 @@ public AnchorNotFoundException(string message, Exception inner)
{
}
-#if !PORTABLE
+#if !(PORTABLE || UNITY)
///
/// Initializes a new instance of the class.
///
@@ -78,4 +78,4 @@ protected AnchorNotFoundException(SerializationInfo info, StreamingContext conte
}
#endif
}
-}
\ No newline at end of file
+}
diff --git a/YamlDotNet/Core/DuplicateAnchorException.cs b/YamlDotNet/Core/DuplicateAnchorException.cs
index b309ec9eb..7268103be 100644
--- a/YamlDotNet/Core/DuplicateAnchorException.cs
+++ b/YamlDotNet/Core/DuplicateAnchorException.cs
@@ -64,7 +64,7 @@ public DuplicateAnchorException(string message, Exception inner)
{
}
-#if !PORTABLE
+#if !(PORTABLE || UNITY)
///
/// Initializes a new instance of the class.
///
@@ -78,4 +78,4 @@ protected DuplicateAnchorException(SerializationInfo info, StreamingContext cont
}
#endif
}
-}
\ No newline at end of file
+}
diff --git a/YamlDotNet/Core/ForwardAnchorNotSupportedException.cs b/YamlDotNet/Core/ForwardAnchorNotSupportedException.cs
index b2df2567c..d1e7f0832 100644
--- a/YamlDotNet/Core/ForwardAnchorNotSupportedException.cs
+++ b/YamlDotNet/Core/ForwardAnchorNotSupportedException.cs
@@ -65,7 +65,7 @@ public ForwardAnchorNotSupportedException(string message, Exception inner)
{
}
-#if !PORTABLE
+#if !(PORTABLE || UNITY)
///
/// Initializes a new instance of the class.
///
@@ -79,4 +79,4 @@ protected ForwardAnchorNotSupportedException(SerializationInfo info, StreamingCo
}
#endif
}
-}
\ No newline at end of file
+}
diff --git a/YamlDotNet/Core/SemanticErrorException.cs b/YamlDotNet/Core/SemanticErrorException.cs
index bce2edfc5..8b5e1cccc 100644
--- a/YamlDotNet/Core/SemanticErrorException.cs
+++ b/YamlDotNet/Core/SemanticErrorException.cs
@@ -64,7 +64,7 @@ public SemanticErrorException(string message, Exception inner)
{
}
-#if !PORTABLE
+#if !(PORTABLE || UNITY)
///
/// Initializes a new instance of the class.
///
diff --git a/YamlDotNet/Core/SyntaxErrorException.cs b/YamlDotNet/Core/SyntaxErrorException.cs
index c19acb4b1..a2b87a947 100644
--- a/YamlDotNet/Core/SyntaxErrorException.cs
+++ b/YamlDotNet/Core/SyntaxErrorException.cs
@@ -64,7 +64,7 @@ public SyntaxErrorException(string message, Exception inner)
{
}
-#if !PORTABLE
+#if !(PORTABLE || UNITY)
///
/// Initializes a new instance of the class.
///
@@ -78,4 +78,4 @@ protected SyntaxErrorException(SerializationInfo info, StreamingContext context)
}
#endif
}
-}
\ No newline at end of file
+}
diff --git a/YamlDotNet/Core/YamlException.cs b/YamlDotNet/Core/YamlException.cs
index 61ca67a00..418c1416d 100644
--- a/YamlDotNet/Core/YamlException.cs
+++ b/YamlDotNet/Core/YamlException.cs
@@ -84,7 +84,7 @@ public YamlException(string message, Exception inner)
{
}
-#if !PORTABLE
+#if !(PORTABLE || UNITY)
///
/// Initializes a new instance of the class.
///
diff --git a/YamlDotNet/Helpers/Portability.cs b/YamlDotNet/Helpers/Portability.cs
index 5479d4d39..97a73431e 100644
--- a/YamlDotNet/Helpers/Portability.cs
+++ b/YamlDotNet/Helpers/Portability.cs
@@ -28,6 +28,18 @@
namespace YamlDotNet
{
+#if (PORTABLE || UNITY)
+ internal static class StandardRegexOptions
+ {
+ public const RegexOptions Compiled = RegexOptions.None;
+ }
+#else
+ internal static class StandardRegexOptions
+ {
+ public const RegexOptions Compiled = RegexOptions.Compiled;
+ }
+#endif
+
#if PORTABLE
///
/// Mock SerializableAttribute to avoid having to add #if all over the place
@@ -83,7 +95,8 @@ public static bool IsAssignableFrom(this Type type, TypeInfo source)
public static TypeCode GetTypeCode(this Type type)
{
- if (type.IsEnum())
+ bool isEnum = type.IsEnum();
+ if (isEnum)
{
type = Enum.GetUnderlyingType(type);
}
@@ -229,11 +242,6 @@ internal enum TypeCode
String = 18,
}
- internal static class StandardRegexOptions
- {
- public const RegexOptions Compiled = RegexOptions.None;
- }
-
internal abstract class DBNull
{
private DBNull() {}
@@ -328,11 +336,6 @@ public static Exception Unwrap(this TargetInvocationException ex)
return result;
}
}
-
- internal static class StandardRegexOptions
- {
- public const RegexOptions Compiled = RegexOptions.Compiled;
- }
internal sealed class CultureInfoAdapter : CultureInfo
{
@@ -351,4 +354,22 @@ public override object GetFormat(Type formatType)
}
#endif
+
+#if UNITY
+ internal static class PropertyInfoExtensions
+ {
+ public static object ReadValue(this PropertyInfo property, object target)
+ {
+ return property.GetGetMethod().Invoke(target, null);
+ }
+ }
+#else
+ internal static class PropertyInfoExtensions
+ {
+ public static object ReadValue(this PropertyInfo property, object target)
+ {
+ return property.GetValue(target, null);
+ }
+ }
+#endif
}
diff --git a/YamlDotNet/Properties/AssemblyInfo.cs b/YamlDotNet/Properties/AssemblyInfo.cs
index 635d0231f..4d7d6434f 100644
--- a/YamlDotNet/Properties/AssemblyInfo.cs
+++ b/YamlDotNet/Properties/AssemblyInfo.cs
@@ -19,6 +19,7 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
+#if !UNITY
using System.Reflection;
using System.Runtime.InteropServices;
using System;
@@ -61,4 +62,6 @@
[assembly: CLSCompliant(true)]
#if !SIGNED
[assembly: InternalsVisibleTo("YamlDotNet.Test")]
+#endif
+
#endif
\ No newline at end of file
diff --git a/YamlDotNet/Serialization/NodeDeserializers/NonGenericListNodeDeserializer.cs b/YamlDotNet/Serialization/NodeDeserializers/NonGenericListNodeDeserializer.cs
index d8f316231..ea66a1c4c 100644
--- a/YamlDotNet/Serialization/NodeDeserializers/NonGenericListNodeDeserializer.cs
+++ b/YamlDotNet/Serialization/NodeDeserializers/NonGenericListNodeDeserializer.cs
@@ -48,8 +48,6 @@ bool INodeDeserializer.Deserialize(EventReader reader, Type expectedType, Func())
{
- var current = reader.Parser.Current;
-
var item = nestedObjectDeserializer(reader, typeof(object));
var promise = item as IValuePromise;
if (promise == null)
diff --git a/YamlDotNet/Serialization/TypeInspectors/ReadablePropertiesTypeInspector.cs b/YamlDotNet/Serialization/TypeInspectors/ReadablePropertiesTypeInspector.cs
index a22fe9b49..c70629817 100644
--- a/YamlDotNet/Serialization/TypeInspectors/ReadablePropertiesTypeInspector.cs
+++ b/YamlDotNet/Serialization/TypeInspectors/ReadablePropertiesTypeInspector.cs
@@ -90,7 +90,7 @@ public T GetCustomAttribute() where T : Attribute
public IObjectDescriptor Read(object target)
{
- var propertyValue = _propertyInfo.GetValue(target, null);
+ var propertyValue = _propertyInfo.ReadValue(target);
var actualType = TypeOverride ?? _typeResolver.Resolve(Type, propertyValue);
return new ObjectDescriptor(propertyValue, actualType, Type, ScalarStyle);
}
diff --git a/YamlDotNet/Serialization/Utilities/TypeConverter.cs b/YamlDotNet/Serialization/Utilities/TypeConverter.cs
index 1480f5c07..1bb24ac82 100644
--- a/YamlDotNet/Serialization/Utilities/TypeConverter.cs
+++ b/YamlDotNet/Serialization/Utilities/TypeConverter.cs
@@ -36,7 +36,7 @@ namespace YamlDotNet.Serialization.Utilities
///
public static class TypeConverter
{
-#if !PORTABLE
+#if !(PORTABLE || UNITY)
///
/// Registers a dynamically.
///
@@ -251,77 +251,5 @@ public static object ChangeType(object value, Type destinationType, CultureInfo
// Default to the Convert class
return Convert.ChangeType(value, destinationType, CultureInfo.InvariantCulture);
}
-
- ///
- /// Tries to parse the specified value.
- ///
- ///
- /// The value.
- ///
- public static T? TryParse(string value) where T : struct
- {
- switch (typeof(T).GetTypeCode())
- {
- case TypeCode.Boolean:
- return (T?)(object)TryParse(value, bool.TryParse);
-
- case TypeCode.Byte:
- return (T?)(object)TryParse(value, byte.TryParse);
-
- case TypeCode.DateTime:
- return (T?)(object)TryParse(value, DateTime.TryParse);
-
- case TypeCode.Decimal:
- return (T?)(object)TryParse(value, decimal.TryParse);
-
- case TypeCode.Double:
- return (T?)(object)TryParse(value, double.TryParse);
-
- case TypeCode.Int16:
- return (T?)(object)TryParse(value, short.TryParse);
-
- case TypeCode.Int32:
- return (T?)(object)TryParse(value, int.TryParse);
-
- case TypeCode.Int64:
- return (T?)(object)TryParse(value, long.TryParse);
-
- case TypeCode.SByte:
- return (T?)(object)TryParse(value, sbyte.TryParse);
-
- case TypeCode.Single:
- return (T?)(object)TryParse(value, float.TryParse);
-
- case TypeCode.UInt16:
- return (T?)(object)TryParse(value, ushort.TryParse);
-
- case TypeCode.UInt32:
- return (T?)(object)TryParse(value, uint.TryParse);
-
- case TypeCode.UInt64:
- return (T?)(object)TryParse(value, ulong.TryParse);
-
- default:
- throw new NotSupportedException(string.Format("Cannot parse type '{0}'.", typeof(T).FullName));
- }
- }
-
- ///
- /// Tries to parse the specified value.
- ///
- ///
- /// The value to be parsed.
- /// The parse function.
- ///
- public static T? TryParse(string value, TryParseDelegate parse) where T : struct
- {
- T result;
- return parse(value, out result) ? (T?)result : null;
- }
-
- ///
- /// Defines a method that is used to tentatively parse a string.
- ///
- public delegate bool TryParseDelegate(string value, out T result);
}
-}
\ No newline at end of file
+}
diff --git a/YamlDotNet/YamlDotNet.csproj b/YamlDotNet/YamlDotNet.csproj
index aad8c7353..0ed168054 100644
--- a/YamlDotNet/YamlDotNet.csproj
+++ b/YamlDotNet/YamlDotNet.csproj
@@ -101,6 +101,31 @@
v4.5
true
+
+ bin\Release-UnitySubset-v35\
+ TRACE;UNITY
+ bin\Release-Unsigned\YamlDotNet.xml
+ true
+ 1591
+ pdbonly
+ AnyCPU
+ prompt
+ AllRules.ruleset
+ Unity Subset v3.5
+
+
+ true
+ bin\Debug-UnitySubset-v35\
+ CODE_ANALYSIS;DEBUG;TRACE;UNITY
+ bin\Debug\YamlDotNet.xml
+ 1591
+ full
+ AnyCPU
+ true
+ prompt
+ MinimumRecommendedRules.ruleset
+ Unity Subset v3.5
+