From beac2f8e27cfc19102fb2ad760cc65a48c0c5c32 Mon Sep 17 00:00:00 2001 From: Nathan Wilson Date: Tue, 1 Sep 2015 11:12:35 +1000 Subject: [PATCH 1/3] Contract for typeconverter.convertfrom --- .../System/System.ComponentModel.TypeConverter.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs b/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs index 077acdff..a682cb42 100644 --- a/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs +++ b/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs @@ -83,7 +83,7 @@ public class TypeConverter // Returns: // true if this converter can perform the conversion; otherwise, false. //public virtual bool CanConvertTo(ITypeDescriptorContext context, Type destinationType); - // + // Summary: // Converts the given value to the type of this converter. // @@ -97,8 +97,12 @@ public class TypeConverter // Exceptions: // System.NotSupportedException: // The conversion cannot be performed. - //public object ConvertFrom(object value); - // + public object ConvertFrom(object value) + { + Contract.Ensures(Contract.Result() != null); + return default(object); + } + // Summary: // Converts the given object to the type of this converter, using the specified // context and culture information. From 2ea7901411a5b8b62a505a150d9bafd3f323e40b Mon Sep 17 00:00:00 2001 From: Nathan Wilson Date: Tue, 1 Sep 2015 11:15:45 +1000 Subject: [PATCH 2/3] Contract for typeconverter.convertfrom --- .../Contracts/System/System.ComponentModel.TypeConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs b/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs index a682cb42..d4f12112 100644 --- a/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs +++ b/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs @@ -83,7 +83,7 @@ public class TypeConverter // Returns: // true if this converter can perform the conversion; otherwise, false. //public virtual bool CanConvertTo(ITypeDescriptorContext context, Type destinationType); - + // // Summary: // Converts the given value to the type of this converter. // From 8d5a20d4f516c3820abc510fedff3e019aa26eb3 Mon Sep 17 00:00:00 2001 From: Nathan Wilson Date: Tue, 1 Sep 2015 11:16:34 +1000 Subject: [PATCH 3/3] Contract for typeconverter.convertfrom --- .../System/System.ComponentModel.TypeConverter.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs b/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs index d4f12112..a1d5a41e 100644 --- a/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs +++ b/Microsoft.Research/Contracts/System/System.ComponentModel.TypeConverter.cs @@ -83,7 +83,7 @@ public class TypeConverter // Returns: // true if this converter can perform the conversion; otherwise, false. //public virtual bool CanConvertTo(ITypeDescriptorContext context, Type destinationType); - // + // // Summary: // Converts the given value to the type of this converter. // @@ -98,10 +98,10 @@ public class TypeConverter // System.NotSupportedException: // The conversion cannot be performed. public object ConvertFrom(object value) - { - Contract.Ensures(Contract.Result() != null); - return default(object); - } + { + Contract.Ensures(Contract.Result() != null); + return default(object); + } // Summary: // Converts the given object to the type of this converter, using the specified