Пример #1
0
        public MainForm(Config config, Updater updater)
        {
            InitializeComponent();

              this.config = config;
              this.updater = updater;
              this.LoadSettings();
              base.Text = base.Text + " " + Version;
              this.lblVersion.Text = Version;
              this.lblExtra.Parent = this.picLogo;
              this.lblVersion.Parent = this.picLogo;
              this.trayIcon.Icon = this.Icon;

              this.server = new HttpServer(config.AppBaseDir + @"\https\localhost.pfx");
              this.server.BindToAllInterfaces = this.cbBindToAll.Checked;
              this.server.UseHttps = this.cbHttps.Checked;
              this.server.LogAllRequests = this.cbLogAllRequests.Checked;

              this.scriptRepository = new ScriptRepository(config.AppBaseDir);
              this.scriptRepository.Log = this.Log;

              this.servlets = new Servlets(this.server, this.scriptRepository, this.Log, this, config.AppBaseDir);
              this.UpdateServletSettings();

              this.ActiveControl = this.comboEmail;
        }
Пример #2
0
        static void Main()
        {
            AppDomain.CurrentDomain.UnhandledException += (sender, args) => HandleException(args.ExceptionObject as Exception);
              Application.ThreadException += (sender, args) => HandleException(args.Exception);

              try
              {
            Config config = new Config();
            config.LoadSettings();
            if (ActivateRunningInstance(config.GetBool("https")))
              return;

            Application.EnableVisualStyles();

            var mainForm = new MainForm(config);
            if (Environment.CommandLine.Contains(WinServiceSwitch))
              WinService.Start(mainForm);
            else
              Application.Run(mainForm);
              }
              catch (Exception ex)
              {
            HandleException(ex);
              }
        }
Пример #3
0
        public MainForm(Config config)
        {
            InitializeComponent();

              this.config = config;
              this.LoadSettings();
              base.Text = base.Text + " " + Version;
              this.lblVersion.Text = Version;
              this.lblExtra.Parent = this.picLogo;
              this.lblVersion.Parent = this.picLogo;
              this.trayIcon.Icon = this.Icon;

              this.server = new HttpServer(null);
              this.server.BindToAllInterfaces = this.cbBindToAll.Checked;
              this.server.LogAllRequests = this.cbLogAllRequests.Checked;

              this.scriptRepository = new ScriptRepository(config.AppBaseDir);
              this.scriptRepository.Log = this.Log;

              this.servlets = new Servlets(this.server, this.scriptRepository, this.Log, this, config.AppBaseDir);
              this.UpdateServletSettings();

              this.ActiveControl = this.btnStartQL;
        }
Пример #4
0
 public Updater(Config config)
 {
     this.config = config;
       Log = msg => LogBuffer.AppendLine(msg);
 }