Skip to content

Commit 4e0e54e

Browse files
committed
ObjectValue.SetValue and Value property setter unified into one method.
Documentation updated. (cherry picked from commit fdffbaa)
1 parent 4c1b70d commit 4e0e54e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ public string Name {
229229
/// <exception cref='InvalidOperationException'>
230230
/// Is thrown when trying to set a value on a read-only ObjectValue
231231
/// </exception>
232+
/// <exception cref="ValueModificationException">
233+
/// When value settings was failed. This exception should be shown to user.
234+
/// </exception>
232235
/// <remarks>
233236
/// This value is a string representation of the ObjectValue. The content depends on several evaluation
234237
/// options. For example, if ToString calls are enabled, this value will be the result of calling
@@ -238,20 +241,13 @@ public string Name {
238241
/// will include the quotation marks and chars like '\' will be properly escaped.
239242
/// If you need to get the real CLR value of the object, use GetRawValue.
240243
/// </remarks>
244+
/// <seealso cref="IObjectValueSource.SetValue"/>
241245
public virtual string Value {
242246
get {
243247
return value;
244248
}
245249
set {
246-
if (IsReadOnly || source == null)
247-
throw new InvalidOperationException ("Value is not editable");
248-
249-
EvaluationResult res = source.SetValue (path, value, null);
250-
if (res != null) {
251-
this.value = res.Value;
252-
displayValue = res.DisplayValue;
253-
isNull = value == null;
254-
}
250+
SetValue (value);
255251
}
256252
}
257253

@@ -291,6 +287,10 @@ public void SetValue (string value)
291287
/// <exception cref='InvalidOperationException'>
292288
/// Is thrown if the value is read-only
293289
/// </exception>
290+
/// <exception cref="ValueModificationException">
291+
/// When value settings was failed. This exception should be shown to user.
292+
/// </exception>
293+
/// <seealso cref="IObjectValueSource.SetValue"/>
294294
public void SetValue (string value, EvaluationOptions options)
295295
{
296296
if (IsReadOnly || source == null)
@@ -299,6 +299,7 @@ public void SetValue (string value, EvaluationOptions options)
299299
if (res != null) {
300300
this.value = res.Value;
301301
displayValue = res.DisplayValue;
302+
isNull = value == null;
302303
}
303304
}
304305

0 commit comments

Comments
 (0)