コード例 #1
0
 public void TearDown(WpfServerController controller)
 {
     try
     {
         if (controller.Model.WorkerThread != null)
         {
             controller.Model.WorkerThread.Abort();
         }
         controller.Model.Router.Dispose();
     }
     catch
     {
     }
 }
コード例 #2
0
ファイル: StartCmd.cs プロジェクト: drweb86/securityonstreets
        public bool Start(WpfServerController controller)
        {
            try
            {
                var localPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
                controller.Model.ServerSettings = ServerSettingsHelper.Load(Path.Combine(SettingsFileLocator.LocateConfigurationFolder(), "MessageRouter.Server.WpfServer.xml"));

                controller.Model.Router       = new WpfRouterServer(controller.Log, controller.Model.ServerSettings);
                controller.Model.WorkerThread = new Thread(controller.Model.Router.Start);
                controller.Model.WorkerThread.Start();

                return(true);
            }
            catch (Exception e)
            {
                controller.Log.Error(e);
                MessageBox.Show(e.ToString(), "Message Router", MessageBoxButton.OK, MessageBoxImage.Error);
                return(false);
            }
        }
コード例 #3
0
 public void OpenLogsFolder(WpfServerController controller)
 {
     Process.Start("explorer.exe", controller.Model.LogsFolder);
 }