Exemplo n.º 1
0
        internal static void Initialize()
        {
            try
            {
                lock (_Lock)
                {
                    if (!_Initialized)
                    {
                        //init the file logger
                        CallStackLogger.Instance.Initialize();

                        //start the wcf server if needed
                        if (SettingsManager.Instance.Settings.AllowDistantControl)
                        {
                            _Host = new WcfHostService();
                            _Host.StartService();
                            _Initialized = true;
                        }

                        //allow capture from the first run
                        if (SettingsManager.Instance.Settings.CaptureOnStart)
                        {
                            _CaptureAllowed = true;
                        }
                    }
                }
            }
            catch (Exception err)
            {
                RuntimeLogger.Instance.Log(LogType.Error, "ReflectionStudio.Spy.Performance.StartEvent {0}", err.Message);
                _Initialized = false;
            }
        }
Exemplo n.º 2
0
 private void btnStartService_Click(object sender, EventArgs e)
 {
     (sender as Button).Enabled = !MainThreadContext.Main.StartService();
     timerJobUpdate.Enabled     = btnStopService.Enabled = true;
     //啟動 WCF 服務
     WcfHostService.StartWcfHost();
 }
Exemplo n.º 3
0
 protected override void OnStart(string[] args)
 {
     MainThreadContext.Main = new MainThread();
     MainThreadContext.Main.StartService();
     //啟動 WCF 服務
     WcfHostService.StartWcfHost();
 }
Exemplo n.º 4
0
 private void btnStopService_Click(object sender, EventArgs e)
 {
     MainThreadContext.Main.StopService();
     //停止 WCF 服務
     WcfHostService.StopWcfHost();
     btnStartService.Enabled = true;
     timerJobUpdate.Enabled  = (sender as Button).Enabled = false;
 }
Exemplo n.º 5
0
 protected override void OnStop()
 {
     MainThreadContext.Main.StopService();
     //停止 WCF 服務
     WcfHostService.StopWcfHost();
 }