次の方法で共有


IVisualizerObjectProvider.IsObjectReplaceable プロパティ

名前空間:  Microsoft.VisualStudio.DebuggerVisualizers
アセンブリ:  Microsoft.VisualStudio.DebuggerVisualizers (Microsoft.VisualStudio.DebuggerVisualizers.dll 内)

構文

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

プロパティ値

型 : System.Boolean
ビジュアル化されるデータ オブジェクトが置き換え可能 (読み取り/書き込み) であるか、置き換え不可能 (読み取り専用) であるかを判断します。

解説

ReplaceData または ReplaceObject を呼び出してデータを置き換えようとする前に、このメソッドを呼び出してオブジェクトが置き換え可能であるかどうかを確認します。このメソッドが 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 名前空間