/// <summary>
        ///   Called when a plugin failed to start. Use this to add custom handling of errors.
        /// Make sure to call base method.
        /// </summary>
        /// <param name="pluginInstance">The plugin that failed to start</param>
        /// <param name="reason">The reason why the plugin failed to start</param>
        /// <param name="errMsg">The error message</param>
        protected virtual void OnPluginStartFailed(TPluginInstance pluginInstance, PluginStartFailure reason, string errMsg)
        {
            switch (reason)
            {
            case PluginStartFailure.InteropAssemblyNotFound:
            case PluginStartFailure.InteropAssemblyInvalidVersionString:
            case PluginStartFailure.InteropAssemblyOutdated:
            case PluginStartFailure.ProcessDidNotStart:
            case PluginStartFailure.ProcessDidNotConnect:
            case PluginStartFailure.Unknown:
                LogTo.Warning("OnPluginStartFailed: " + errMsg);
                break;
            }

            using (pluginInstance.Lock.Lock())
            {
                if (pluginInstance.Status == PluginStatus.Stopped)
                {
                    return;
                }

                RunningPluginMap.TryRemove(pluginInstance.Guid, out _);

                pluginInstance.OnStopped(false);
            }
        }
Пример #2
0
        /// <inheritdoc />
        protected override void OnPluginStartFailed(
            PluginInstance pluginInstance,
            PluginStartFailure reason,
            string errMsg)
        {
            base.OnPluginStartFailed(pluginInstance, reason, errMsg);

            errMsg.ShowDesktopNotification();
        }