public IRemotePlugin LoadPlugin(IWpfHost host, PluginStartupInfo startupInfo) { _host = host; _log.Info(String.Format("LoadPlugin('{0}','{1}')", startupInfo.AssemblyName, startupInfo.MainClass)); new ProcessMonitor(Dispose).Start(_host.HostProcessId); Func <PluginStartupInfo, object> createOnUiThread = LoadPluginOnUiThread; var result = _dispatcher.Invoke(createOnUiThread, startupInfo); _log.Debug("Returning plugin object to host"); if (result is Exception) { _log.Error("Error loading plugin", (Exception)result); throw new TargetInvocationException((Exception)result); } return((IRemotePlugin)result); }
protected override void OnStop() { try { LocalLog.Info("Stopping RantaLogService。"); host.Close(); LocalLog.Info("RantaLogService stopped."); } catch (Exception ex) { LocalLog.Error(ex.ToString()); } }
protected override void OnStop() { try { LocalLog.Info("Stopping MessageProcessor."); processor.Stop(); LocalLog.Info("MessageProcessor stopped."); } catch (Exception ex) { LocalLog.Error(ex.ToString()); } }
protected override void OnStart(string[] args) { try { LocalLog.Info("Starting RantaLogService."); host = new ServiceHost(typeof(LogService)); host.Open(); LocalLog.Info("RantaLogService Started."); } catch (Exception ex) { LocalLog.Error(ex.ToString()); } }
protected override void OnStart(string[] args) { try { LocalLog.Info("Starting MessageProcessor."); processor = new MessageProcessor(); processor.Start(); LocalLog.Info("MessageProcessor started."); } catch (Exception ex) { LocalLog.Error(ex.ToString()); } }