IVisualizerObjectProvider2 Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides additional functionality to pass data from the debuggee to the visualizer.
public interface class IVisualizerObjectProvider2 : Microsoft::VisualStudio::DebuggerVisualizers::IVisualizerObjectProvider
public interface IVisualizerObjectProvider2 : Microsoft.VisualStudio.DebuggerVisualizers.IVisualizerObjectProvider
type IVisualizerObjectProvider2 = interface
interface IVisualizerObjectProvider
Public Interface IVisualizerObjectProvider2
Implements IVisualizerObjectProvider
- Derived
- Implements
Remarks
The IVisualizerObjectProvider object passed to DialogDebuggerVisualizer's Show(IDialogVisualizerService, IVisualizerObjectProvider) method for VS 16.10 onward is of this type, so you should cast it to use this new functionality.
Properties
IsBinaryFormatterSupported |
Specifies if the debuggee supports the BinaryFormatter since it was deprecated in .NET 5. If it does not, the provider most use JSON to communicate with the visualizer. (Inherited from IVisualizerObjectProvider) |
IsObjectReplaceable |
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). (Inherited from IVisualizerObjectProvider) |
Methods
Deserialize(Stream) |
Obsolete.
Legacy helper method used by old visualizers that makes it easier to write deserialization code. It uses default binary serialization to read the given object from the stream. However, due to security vulnerabilities with its usage, it should no longer be used, and will throw on newer versions of .NET like ASP.NET Core 5.0. If called on a target app that supports Binary Serialization, after the method finishes the stream is read and we return the underlying object. |
GetData() |
Gets an initial blob of data about the object being debugged. The data is written into the provided MemoryStream. (Inherited from IVisualizerObjectProvider) |
GetDeserializableObject() |
Gets the data using GetData and then returns an IDeserializableObject so that the caller can deserialize with JSON if default seriallization is not supported. |
GetDeserializableObjectFrom(Stream) |
Helper method that can be used to get a deserializable object for cases in which the target app might not support Binary Serialization. In these cases the underlying format should be serialized using JSON, so callers can query individual properties to determine the type of the object they want to deserialize. |
GetObject() |
Obsolete.
Gets the data using GetData and then deserializes assuming that default serialization has been done (Inherited from IVisualizerObjectProvider) |
ReplaceData(Stream) |
Creates a replacement copy of the object based on the serialized data given. (Inherited from IVisualizerObjectProvider) |
ReplaceObject(Object) |
Serializes the object using default serialization and then sets the data using ReplaceData (Inherited from IVisualizerObjectProvider) |
Serialize(Object, Stream) |
Helper method which makes it easier to write serialization code. If the target app supports Binary Serialization it serializes the object into the stream with the help of the BinaryFormatter class. If that is not supported, which is the case in newer versions of .NET, it defaults to serialize the object in JSON format. |
TransferData(Stream) |
Transfers the data bidirectionally to the TransferData method on the VisualizerObjectSource (Inherited from IVisualizerObjectProvider) |
TransferDeserializableObject(Object) |
Serializes the outgoing object using as an IDeserializableObject and then calls TransferData. Upon return deserializes the incoming data and returns the object wrapped in an IDeserializableObject. |
TransferObject(Object) |
Obsolete.
Serializes the outgoing object using default serialization and then calls TransferData. Upon return deserializes the incoming data and returns the deserialized object (Inherited from IVisualizerObjectProvider) |