System/PCL: Implement HttpWebRequest.SupportsCookieContainer, WebRequest.CreateHttp...
[mono.git] / mcs / class / System / System.Configuration / SettingsPropertyValue.cs
index d71f606f85dacfb7074b5ae4c88b5d84e538080d..9bf62c00c62a743e986ca0439c5bd075f5f7678f 100644 (file)
@@ -26,7 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
 using System;
 using System.Globalization;
 using System.IO;
@@ -160,10 +159,19 @@ namespace System.Configuration
                        }
                }
 
+               internal object Reset ()
+               {
+                       propertyValue = GetDeserializedDefaultValue ();
+                       dirty = true;
+                       defaulted = true;
+                       needPropertyValue = true;
+                       return propertyValue;
+               }
+
                private object GetDeserializedDefaultValue ()
                {
                        if (property.DefaultValue == null)
-                               if (property.PropertyType.IsValueType)
+                               if (property.PropertyType != null && property.PropertyType.IsValueType)
                                        return Activator.CreateInstance (property.PropertyType);
                                else
                                        return null;
@@ -235,4 +243,3 @@ namespace System.Configuration
 
 }
 
-#endif