Beispiel #1
0
        void FadeOut()
        {
            if (InFadeOut)
                return;

            if (SystemInformation.TerminalServerSession)
            {
                if (Startup)
                    Application.ExitThread();

                StressForm = null;
                base.Close();
                return;
            }

            int duration = 500;//in milliseconds
            int steps = 50;
            Timer timer = new Timer();
            timer.Interval = duration / steps;
            timer.Enabled = true;

            int currentStep = steps;
            timer.Tick += (arg1, arg2) =>
            {
                Opacity = ((double)currentStep) / steps;
                currentStep--;

                if (currentStep <= 0)
                {
                    timer.Stop();
                    timer.Dispose();

                    if (Startup)
                        Application.ExitThread();

                    Visible = false;

                    if (StressForm != null && StressForm.Visible)
                        StressForm.Invoke(new Action(() =>
                        {
                            if (StressForm != null)
                            {
                                StressForm.TopMost = true;
                                Application.DoEvents();
                                StressForm.TopMost = false;
                            }
                        }));

                    StressForm = null;
                    base.Close();

                }
            };

            timer.Start();
        }
        public FiddlerCapture(StressTestForm form)
        {
            InitializeComponent();
            CaptureConfiguration = App.Configuration.UrlCapture;
            MainForm = form;

            if (!string.IsNullOrEmpty(App.Configuration.UrlCapture.Cert))
            {
            FiddlerApplication.Prefs.SetStringPref("fiddler.certmaker.bc.key", App.Configuration.UrlCapture.Key);
            FiddlerApplication.Prefs.SetStringPref("fiddler.certmaker.bc.cert", App.Configuration.UrlCapture.Cert);
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            string fileName = null;
            if (args != null && args.Length > 0)
                fileName = args[0];

            // Force config to apply im
            var obj = App.UserDataPath;

            var limit = ServicePointManager.DefaultConnectionLimit;
            if (ServicePointManager.DefaultConnectionLimit < 5)
                ServicePointManager.DefaultConnectionLimit = 50;

            //ServicePointManager.MaxServicePoints = 50;
            //ServicePointManager.MaxServicePointIdleTime = 100;

            // setting using config file switch
            //ServicePointManager.Expect100Continue = false;

            ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls11 | SecurityProtocolType.Tls12;

            if (App.Configuration.StressTester.IgnoreCertificateErrors)
            {
                ServicePointManager.ServerCertificateValidationCallback += (sender, cert, chain, sslPolicyErrors) => true;
            }

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            var mainForm = new StressTestForm(fileName);

            Thread newThread = new Thread(RunSplash);
            newThread.SetApartmentState(ApartmentState.STA);
            newThread.Name = "Splash";
            newThread.Start(mainForm);

            Application.ThreadException += Application_ThreadException;
            try
            {
                Application.Run(mainForm);
            }
            catch (Exception ex)
            {
                Application_ThreadException(null, new ThreadExceptionEventArgs(ex));
            }
        }
 private void FiddlerCapture_FormClosing(object sender, FormClosingEventArgs e)
 {
     Stop();
     MainForm = null;
 }