IVisualizerObjectProvider.IsObjectReplaceable 屬性

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

語法

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

屬性值

型別:System.Boolean
判斷視覺化中的資料物件是可取代 (讀取/寫入) 還是無法取代 (唯讀)。

備註

在您呼叫 ReplaceDataReplaceObject 以嘗試取代資料之前,請先呼叫此方法來判斷物件是否為可取代。如果這個方法傳回 false 值,則將物件視為唯讀。

範例

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 安全性

請參閱

參考

IVisualizerObjectProvider 介面

Microsoft.VisualStudio.DebuggerVisualizers 命名空間