Exemple #1
0
        static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                var cfg = CommandLine.Parse(args);
                FusionRegistry.WriteLogConfiguration(cfg);
                return;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new ConfigDialog());
        }
        private void FusionConfigDialog_Load(object sender, EventArgs e)
        {
            _configuration              = FusionRegistry.ReadLogConfiguration();
            chkForceLog.Checked         = _configuration.ForceLog;
            chkLogFailures.Checked      = _configuration.LogFailures;
            chkLogResourceBinds.Checked = _configuration.LogResourceBinds;
            txtLogPath.Text             = _configuration.LogDirectory ?? "";

            if (AdminProcessStarter.ElevationRequired)
            {
                AddShieldToButton(btnApply);
                AddShieldToButton(btnOK);
            }

            chkForceLog.CheckStateChanged += delegate
            {
                _configuration.ForceLog = chkForceLog.Checked;
                btnApply.Enabled        = true;
            };
            chkLogFailures.CheckStateChanged += delegate
            {
                _configuration.LogFailures = chkLogFailures.Checked;
                btnApply.Enabled           = true;
            };
            chkLogResourceBinds.CheckStateChanged += delegate
            {
                _configuration.LogResourceBinds =
                    chkLogResourceBinds.Checked;
                btnApply.Enabled = true;
            };
            txtLogPath.TextChanged += delegate
            {
                _configuration.LogDirectory = txtLogPath.Text;
                btnApply.Enabled            = true;
            };
        }