internal FiddlerAppContext(ILogger logger)
        {
            _logger = logger;

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.ApplicationExit += OnApplicationExit;

            FiddlerOptions.SetLogger(_logger);
            FiddlerOptions.Startup();

            _logger.Information("Starting loading profile form...");
            var profile = new LoadProfile {
                TopMost = true
            };
            var profileResult = profile.ShowDialog();

            if (profileResult == DialogResult.Cancel)
            {
                _logger.Information("No profile loaded... exiting.");
                return;
            }

            if (FiddlerOptions.UpdateCheckOnStart)
            {
                _logger.Information("Update check. Current version is {currentVersion}", FiddlerOptions.AppVersion);
                UpdateRunner.RunAsync(FiddlerOptions.RepositoryOwner, FiddlerOptions.RepositoryName, FiddlerOptions.AppVersion, false).GetAwaiter().GetResult();
            }

            _logger.Information("Starting main form...");
            MainForm = new MainForm();
            MainForm.Show();
        }
示例#2
0
        private static void Load()
        {
            string FileName = Path.Combine(FiddlerControls.Options.AppDataPath, "Options_default.xml");

            if (!File.Exists(FileName))
            {
                return;
            }
            LoadProfile profileform = new LoadProfile();

            profileform.TopMost = true;
            profileform.ShowDialog();
            //loadProfile(FileName);
        }
示例#3
0
 private static void Load()
 {
     string FileName = Path.Combine(FiddlerControls.Options.AppDataPath, "Options_default.xml");
     if (!File.Exists(FileName))
         return;
     LoadProfile profileform = new LoadProfile();
     profileform.TopMost = true;
     profileform.ShowDialog();
     //loadProfile(FileName);
 }