Udostępnij za pośrednictwem


IVisualizerObjectProvider.IsObjectReplaceable Property

Namespace:  Microsoft.VisualStudio.DebuggerVisualizers
Assembly:  Microsoft.VisualStudio.DebuggerVisualizers (in Microsoft.VisualStudio.DebuggerVisualizers.dll)

Syntax

'Declaration
ReadOnly Property IsObjectReplaceable As Boolean
    Get
bool IsObjectReplaceable { get; }
property bool IsObjectReplaceable {
    bool get ();
}
abstract IsObjectReplaceable : bool
function get IsObjectReplaceable () : boolean

Property Value

Type: System.Boolean
Determines whether the data object being visualized is replaceable (read/write) or nonreplaceable (read only).

Remarks

Before you attempt to replace data by calling ReplaceData or ReplaceObject, call this method to determine whether the object is replaceable. If this method returns a value of false, treat the object as read-only.

Examples

public class DebuggerSide : DialogDebuggerVisualizer
{
   override protected void Show(IDialogVisualizerService windowService, IVisualizerObjectProvider objectProvider)
   {
      // Get a string from the debuggee side and display it in a message box.
      String myString = objectProvider.GetObject().ToString();
      MessageBox.Show(myString);
      
      // Modify the string and send it back to the debuggee side.
      String myNewString = myString.ToUpper();
      // Make sure the object is replacable before you try to replace it.
      // Otherwise, you will get an exception.
      if (objectProvider.IsObjectReplaceable)
      {
         objectProvider.ReplaceObject(myNewString);
      }
   }
// Other DebuggerSide methods ommitted for clarity.
}

.NET Framework Security

See Also

Reference

IVisualizerObjectProvider Interface

Microsoft.VisualStudio.DebuggerVisualizers Namespace