Skip to content
This repository has been archived by the owner on Aug 1, 2019. It is now read-only.

Commit

Permalink
ObjectValue.SetValue and Value property setter unified into one method.
Browse files Browse the repository at this point in the history
Documentation updated.
  • Loading branch information
nerzhulart committed Feb 8, 2017
1 parent 316b7cc commit fdffbaa
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions Mono.Debugging/Mono.Debugging.Client/ObjectValue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ public string Name {
/// <exception cref='InvalidOperationException'>
/// Is thrown when trying to set a value on a read-only ObjectValue
/// </exception>
/// <exception cref="ValueModificationException">
/// When value settings was failed. This exception should be shown to user.
/// </exception>
/// <remarks>
/// 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
Expand All @@ -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.
/// </remarks>
/// <seealso cref="IObjectValueSource.SetValue"/>
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);
}
}

Expand Down Expand Up @@ -291,6 +287,10 @@ public void SetValue (string value)
/// <exception cref='InvalidOperationException'>
/// Is thrown if the value is read-only
/// </exception>
/// <exception cref="ValueModificationException">
/// When value settings was failed. This exception should be shown to user.
/// </exception>
/// <seealso cref="IObjectValueSource.SetValue"/>
public void SetValue (string value, EvaluationOptions options)
{
if (IsReadOnly || source == null)
Expand All @@ -299,6 +299,7 @@ public void SetValue (string value, EvaluationOptions options)
if (res != null) {
this.value = res.Value;
displayValue = res.DisplayValue;
isNull = value == null;
}
}

Expand Down

0 comments on commit fdffbaa

Please sign in to comment.