From fdffbaabe856225375dd17e2580d535ba01b57d8 Mon Sep 17 00:00:00 2001 From: Artem Bukhonov Date: Thu, 9 Feb 2017 00:37:48 +0300 Subject: [PATCH] ObjectValue.SetValue and Value property setter unified into one method. Documentation updated. --- .../Mono.Debugging.Client/ObjectValue.cs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs b/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs index 366150b21..a0bea3990 100644 --- a/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs +++ b/Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs @@ -229,6 +229,9 @@ public string Name { /// /// Is thrown when trying to set a value on a read-only ObjectValue /// + /// + /// When value settings was failed. This exception should be shown to user. + /// /// /// This value is a string representation of the ObjectValue. The content depends on several evaluation /// options. For example, if ToString calls are enabled, this value will be the result of calling @@ -238,20 +241,13 @@ public string Name { /// will include the quotation marks and chars like '\' will be properly escaped. /// If you need to get the real CLR value of the object, use GetRawValue. /// + /// public virtual string Value { get { return value; } set { - if (IsReadOnly || source == null) - throw new InvalidOperationException ("Value is not editable"); - - EvaluationResult res = source.SetValue (path, value, null); - if (res != null) { - this.value = res.Value; - displayValue = res.DisplayValue; - isNull = value == null; - } + SetValue (value); } } @@ -291,6 +287,10 @@ public void SetValue (string value) /// /// Is thrown if the value is read-only /// + /// + /// When value settings was failed. This exception should be shown to user. + /// + /// public void SetValue (string value, EvaluationOptions options) { if (IsReadOnly || source == null) @@ -299,6 +299,7 @@ public void SetValue (string value, EvaluationOptions options) if (res != null) { this.value = res.Value; displayValue = res.DisplayValue; + isNull = value == null; } }