Example #1
0
        public void Dispose()
        {
            if (_interceptor != null)
            {
                _interceptor.Dispose();
                _interceptor = null;
            }

            if (Log != null)
            {
                Log.Close();
                Log = null;
            }
        }
Example #2
0
        public ServerController()
        {
            Log = new QueueLog(
                new ConsoleLog(),
                new SimpleFileLog(
                    Path.Combine(
                        Path.GetTempPath(),
                        AppName)));

            Log.Open();

            AppDomain.CurrentDomain.UnhandledException += (s, e) => ReportIssue(e.ExceptionObject);
            OperationMode = (OperationMode)Enum.Parse(typeof(OperationMode), ConfigurationManager.AppSettings["OperationMode"], true);

            if (OperationMode == OperationMode.Debug)
            {
                _interceptor = new DebugInterceptor();
            }
            Model = new ServerModel(_interceptor);
        }