共用方式為


IVisualizerObjectProvider.ReplaceObject 方法

命名空間:  Microsoft.VisualStudio.DebuggerVisualizers
組件:  Microsoft.VisualStudio.DebuggerVisualizers (在 Microsoft.VisualStudio.DebuggerVisualizers.dll 中)

語法

'宣告
Sub ReplaceObject ( _
    newObject As Object _
)
void ReplaceObject(
    Object newObject
)
void ReplaceObject(
    Object^ newObject
)
abstract ReplaceObject : 
        newObject:Object -> unit
function ReplaceObject(
    newObject : Object
)

參數

  • newObject
    類型:Object

    要取代正以視覺化方式檢視之物件的新物件。

備註

使用指定的新物件,取代以視覺化方式檢視的物件。 這樣會導致 newObject 參數序列化並傳遞至 ReplaceData 方法。

範例

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)
      {
      // This example assumes the object source is expecting a string.
         objectProvider.ReplaceObject(myNewString);
      }
   }
// Other DebuggerSide methods ommitted for clarity.
}

.NET Framework 安全性

請參閱

參考

IVisualizerObjectProvider 介面

Microsoft.VisualStudio.DebuggerVisualizers 命名空間