193
/// Gets or sets the value of the object
198
/// <exception cref='InvalidOperationException'>
199
/// Is thrown when trying to set a value on a read-only ObjectValue
202
/// This value is a string representation of the ObjectValue. The content depends on several evaluation
203
/// options. For example, if ToString calls are enabled, this value will be the result of calling
205
/// If the object is a primitive type, in general the Value will be an expression that represents the
206
/// value in the target language. For example, when debugging C#, if the property is an string, the value
207
/// will include the quotation marks and chars like '\' will be properly escaped.
208
/// If you need to get the real CLR value of the object, use GetRawValue.
186
210
public virtual string Value {
226
/// Gets or sets the display value of this object
229
/// This method returns a string to be used when showing the value of this object.
230
/// In most cases, the Value and DisplayValue properties return the same text, but there are some cases
231
/// in which DisplayValue may return a more convenient textual representation of the value, which
232
/// may not be a valid target language expression.
233
/// For example in C#, an enum Value includes the full enum type name (e.g. "Gtk.ResponseType.OK"),
234
/// while DisplayValue only has the enum value name ("OK").
236
public string DisplayValue {
237
get { return displayValue ?? Value; }
238
set { displayValue = value; }
242
/// Sets the value of this object, using the default evaluation options
201
244
public void SetValue (string value)
203
246
SetValue (value, parentFrame.DebuggerSession.EvaluationOptions);
250
/// Sets the value of this object, using the specified evaluation options
252
/// <param name='value'>
255
/// <param name='options'>
258
/// <exception cref='InvalidOperationException'>
259
/// Is thrown if the value is read-only
206
261
public void SetValue (string value, EvaluationOptions options)
208
263
if (IsReadOnly || source == null)
273
/// Gets the raw value of this object
279
/// This method can be used to get the CLR value of the object. For example, if this ObjectValue is
280
/// a property of type String, this method will return the System.String value of the property.
281
/// If this ObjectValue refers to an object instead of a primitive value, then a RawValue object
282
/// will be returned. RawValue can be used to get and set members of an object, and to call methods.
283
/// If this ObjectValue refers to an array, then a RawValueArray object will be returned.
217
285
public object GetRawValue ()
219
287
return GetRawValue (parentFrame.DebuggerSession.EvaluationOptions);
291
/// Gets the raw value of this object
293
/// <param name='options'>
294
/// The evaluation options
300
/// This method can be used to get the CLR value of the object. For example, if this ObjectValue is
301
/// a property of type String, this method will return the System.String value of the property.
302
/// If this ObjectValue refers to an object instead of a primitive value, then a RawValue object
303
/// will be returned. RawValue can be used to get and set members of an object, and to call methods.
304
/// If this ObjectValue refers to an array, then a RawValueArray object will be returned.
222
306
public object GetRawValue (EvaluationOptions options)
224
308
object res = source.GetRawValue (path, options);
316
/// Sets the raw value of this object
318
/// <param name='value'>
322
/// The provided value can be a primitive type, a RawValue object or a RawValueArray object.
231
324
public void SetRawValue (object value)
233
326
SetRawValue (value, parentFrame.DebuggerSession.EvaluationOptions);
330
/// Sets the raw value of this object
332
/// <param name='value'>
335
/// <param name='options'>
336
/// The evaluation options
339
/// The provided value can be a primitive type, a RawValue object or a RawValueArray object.
236
341
public void SetRawValue (object value, EvaluationOptions options)
238
343
source.SetRawValue (path, value, options);
241
public string DisplayValue {
242
get { return displayValue ?? Value; }
243
set { displayValue = value; }
347
/// Full name of the type of the object
246
349
public string TypeName {
247
350
get { return typeName; }
248
351
set { typeName = value; }
252
/// The expression to concatenate to a parent expression to get this child
253
/// (for example ".foo" if this object represents a "foo" field of an object
355
/// Gets or sets the child selector.
358
/// The child selector is an expression which can be concatenated to a parent expression to get this child.
359
/// For example, if this object is a reference to a field named 'foo' of an object, the child
360
/// selector is '.foo'.
255
362
public string ChildSelector {
257
364
if (childSelector != null)
264
371
set { childSelector = value; }
375
/// Gets a value indicating whether this object has children.
378
/// <c>true</c> if this instance has children; otherwise, <c>false</c>.
267
380
public bool HasChildren {
269
382
if (IsEvaluating)
398
/// Gets a child value
403
/// <param name='name'>
404
/// Name of the member
407
/// This method can be used to get a member of an object (such as a field or property)
284
409
public ObjectValue GetChild (string name)
286
411
return GetChild (name, parentFrame.DebuggerSession.EvaluationOptions);
415
/// Gets a child value
420
/// <param name='name'>
421
/// Name of the member
423
/// <param name='options'>
424
/// Options to be used to evaluate the child
427
/// This method can be used to get a member of an object (such as a field or property)
289
429
public ObjectValue GetChild (string name, EvaluationOptions options)
296
436
if (children == null) {
297
437
children = new List<ObjectValue> ();
299
ObjectValue[] cs = source.GetChildren (path, -1, -1, options);
300
ConnectCallbacks (parentFrame, cs);
301
children.AddRange (cs);
302
} catch (Exception ex) {
304
return CreateFatalError ("", ex.Message, ObjectValueFlags.ReadOnly);
438
if (source != null) {
440
ObjectValue[] cs = source.GetChildren (path, -1, -1, options);
441
ConnectCallbacks (parentFrame, cs);
442
children.AddRange (cs);
443
} catch (Exception ex) {
445
return CreateFatalError ("", ex.Message, ObjectValueFlags.ReadOnly);
307
449
foreach (ObjectValue ob in children)
456
/// Gets all children of the object
459
/// An array of all child values
313
461
public ObjectValue[] GetAllChildren ()
315
463
return GetAllChildren (parentFrame.DebuggerSession.EvaluationOptions);
467
/// Gets all children of the object
470
/// An array of all child values
472
/// <param name='options'>
473
/// Options to be used to evaluate the children
318
475
public ObjectValue[] GetAllChildren (EvaluationOptions options)
320
477
if (IsEvaluating)
327
484
if (children == null) {
328
485
children = new List<ObjectValue> ();
330
ObjectValue[] cs = source.GetChildren (path, -1, -1, options);
331
ConnectCallbacks (parentFrame, cs);
332
children.AddRange (cs);
333
} catch (Exception ex) {
334
Console.WriteLine (ex);
335
children.Add (CreateFatalError ("", ex.Message, ObjectValueFlags.ReadOnly));
486
if (source != null) {
488
ObjectValue[] cs = source.GetChildren (path, -1, -1, options);
489
ConnectCallbacks (parentFrame, cs);
490
children.AddRange (cs);
491
} catch (Exception ex) {
492
if (parentFrame != null)
493
parentFrame.DebuggerSession.OnDebuggerOutput( true, ex.ToString());
494
children.Add (CreateFatalError ("", ex.Message, ObjectValueFlags.ReadOnly));
338
498
return children.ToArray ();
503
/// Gets an item of an array
508
/// <param name='index'>
511
/// <exception cref='InvalidOperationException'>
512
/// Is thrown if this object is not an array (IsArray returns false)
342
514
public ObjectValue GetArrayItem (int index)
344
516
return GetArrayItem (index, parentFrame.DebuggerSession.EvaluationOptions);
520
/// Gets an item of an array
525
/// <param name='index'>
528
/// <param name='options'>
529
/// Options to be used to evaluate the item
531
/// <exception cref='InvalidOperationException'>
532
/// Is thrown if this object is not an array (IsArray returns false)
347
534
public ObjectValue GetArrayItem (int index, EvaluationOptions options)
636
/// Refreshes the value of this object
639
/// This method can be called to get a more up-to-date value for this object.
442
641
public void Refresh ()
444
643
Refresh (parentFrame.DebuggerSession.EvaluationOptions);
647
/// Refreshes the value of this object
650
/// This method can be called to get a more up-to-date value for this object.
447
652
public void Refresh (EvaluationOptions options)