IHYCrossPlatformWrapper
Overview
The IHYCrossPlatformWrapper interface is used to provide methods for a wrapper for managed plugins that use WPF. In the Hydra framework, this interface is implemented by the VisualPluginWrapper
class to provide base implementation of the wrapper.
There is no need to use this interface directly; if you want to use custom interfaces inside your WPF plugin, you have to create a wrapper class to make it COM interoperable, for example:
//custom interface
[Guid("4DE68814-FA8B-4ce8-9FA8-32B7535B6961")]
public interface ICustomInterface: IHYCrossPlatformInterface
{
void PrintSomething(string S);
}
//wrapper class
public class PluginWrapper: VisualPluginWrapper, ICustomInterface
{
private new Plugin1 PluginInstance { get { return base.PluginInstance as Plugin1; } }
public void PrintSomething(string S)
{
PluginInstance.PrintSomething(S);
}
}
You álso have to add the NeedsManagedWrapperAttribute to your plugin, as shown below:
[Plugin, VisualPlugin, NeedsManagedWrapper(typeof(PluginWrapper))]
public partial class Plugin1 : RemObjects.Hydra.WPF.VisualPlugin, ICustomInterface
Note: Take a look at the Delphi WPF sample shipped with Hydra to see plugins with WPF in action.
Location
- Reference: RemObjects.Hydra.dll
- Namespace: RemObjects.Hydra.CrossPlatform
- Ancestry: IHYCrossPlatformInterface | IHYCrossPlatformWrapper
Required Methods
CreateInternalInstance
method CreateInternalInstance(pluginType: Type)
void CreateInternalInstance(Type pluginType)
Sub CreateInternalInstance(pluginType As Type)
Parameters:
- pluginType:
- NeedsManagedWrapperAttribute
-
IHYCrossPlatformWrapper Interface
- .NET
- Delphi