/// <summary>
        /// Called by the Interop loader to retrieve the plugin information.
        /// </summary>
        /// <param name="hostCmdStub">Must not be null.</param>
        /// <returns>Returns a fully populated <see cref="VstPluginInfo"/> instance. Never returns null.</returns>
        /// <remarks>Override <see cref="CreatePluginInfo"/> to change the default behavior of how the plugin info is built.</remarks>
        public VstPluginInfo GetPluginInfo(IVstHostCommandStub hostCmdStub)
        {
            IVstPlugin plugin = CreatePluginInstance();

            if (plugin != null)
            {
                pluginCtx = new VstPluginContext();
                pluginCtx.Host = new Host.VstHost(hostCmdStub, plugin);
                pluginCtx.Plugin = plugin;
                pluginCtx.PluginInfo = CreatePluginInfo(plugin);

                return pluginCtx.PluginInfo;
            }

            return null;
        }
 /// <summary>
 /// This is the last method the host calls. Dispose your resources.
 /// </summary>
 /// <remarks>Always call the base class when overriding.</remarks>
 public virtual void Close()
 {
     if (pluginCtx != null)
     {
         pluginCtx.Dispose();
         pluginCtx = null;
     }
 }