Edit

Share via


IRemoteObjectContract.RemoteCast(String) Method

Definition

Casts the object identified by the current IRemoteObjectContract to a specified type.

public:
 System::AddIn::Contract::RemoteArgument RemoteCast(System::String ^ canonicalName);
public System.AddIn.Contract.RemoteArgument RemoteCast (string canonicalName);
abstract member RemoteCast : string -> System.AddIn.Contract.RemoteArgument
Public Function RemoteCast (canonicalName As String) As RemoteArgument

Parameters

canonicalName
String

The canonical name of the type to cast the object to.

Returns

A RemoteArgument that represents the result of the cast operation.

Remarks

A canonical name is a globally unique name, such as a GUID. Strings in the format <assembly name>, <fully qualified type name> are recommended. An example of the recommended format of a canonical name is "ShapeApp, Microsoft.VisualStudio.Tools.Applications.Samples.ShapeApp.Application".

The canonical name for a type cannot change after a type is published in a component. Changing the canonical name of a type in a future version of a component breaks compatibility between the component and clients that are already using the type.

It is recommended that RemoteCast implementations throw an InvalidCastException if the cast operation fails.

Applies to