Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
 private static void Main()
 {
     try
     {
         Application.EnableVisualStyles();
         Application.SetCompatibleTextRenderingDefault(false);
         FiddlerOptions.Startup();
         Application.Run(new Forms.UoFiddler());
         FiddlerOptions.Save();
         Map.SaveMapOverlays();
     }
     catch (Exception err)
     {
         Clipboard.SetDataObject(err.ToString(), true);
         Application.Run(new ExceptionForm(err));
     }
 }