Share via


IVisualizerObjectProvider.IsObjectReplaceable Property

Definition

Specifies whether a replacement object can be created. That is, determines whether the data object being visualized is replaceable (read/write) or nonreplaceable (read only).

public:
 property bool IsObjectReplaceable { bool get(); };
public:
 property bool IsObjectReplaceable { bool get(); };
public bool IsObjectReplaceable { get; }
member this.IsObjectReplaceable : bool
Public ReadOnly Property IsObjectReplaceable As Boolean

Property Value

Determines whether the data object being visualized is replaceable (read/write) or nonreplaceable (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<string>();
        MessageBox.Show(myString);

        // Modify the string and send it back to the debuggee side.  
        String myNewString = myString.ToUpper();
        // Make sure the object is replaceable before you try to replace it.  
        // Otherwise, you will get an exception.  
        if (objectProvider.IsObjectReplaceable)
        {
               objectProvider.ReplaceObject(myNewString);
        }
    }
    // Other DebuggerSide methods omitted for clarity.  
}

Remarks

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

Applies to