/// <summary> /// /// </summary> /// <param name="plugin"></param> /// <returns></returns> internal static bool PluginRemove(IUlibPlugin plugin) { var tp = plugin.GetType(); var ioface = tp.GetInterface("IQualityPlugin"); if (ioface != null) { /*var gatewayKey = tp.GetProperty("Key"); * if (_gateways.ContainsKey(gatewayKey.ToString())) * _gateways.Remove(gatewayKey.ToString());*/ } return(true); }
/// <summary> /// /// </summary> /// <param name="plugin"></param> /// <returns></returns> internal static bool PluginRemove(IUlibPlugin plugin) { var tp = plugin.GetType(); var ioface = tp.GetInterface("IObjectSerializer"); if (ioface != null) { var externalPlugin = (IObjectSerializer)plugin; if (TypeEncoders.ContainsKey(externalPlugin.ObjectType)) { lock (TypeEncoders) TypeEncoders.Remove(externalPlugin.ObjectType); } if (TypeDecoders.ContainsKey(externalPlugin.ObjectCode)) { lock (TypeDecoders) TypeDecoders.Remove(externalPlugin.ObjectCode); } } var icface = tp.GetInterface("IComponentSerializer"); if (icface != null) { var externalPlugin = (IComponentSerializer)plugin; if (ComponentEncoders.ContainsKey(externalPlugin.ClassName)) { lock (ComponentEncoders) ComponentEncoders.Remove(externalPlugin.ClassName); } if (ComponentDecoders.ContainsKey(externalPlugin.ClassName)) { lock (ComponentDecoders) ComponentDecoders.Remove(externalPlugin.ClassName); } } return(true); }