Exemplo n.º 1
0
        public static void StartAsync(Action <SpeedTestResult> actionWhenCompleted)
        {
            // ChildWindow msgBox = PopupHelper.PopupMessage(DialogTitles.Initializing, SR.CheckingConnectionSpeed);

            ConnectionTester test = new ConnectionTester();

            test.SpeedTestCompleted += (s, ev) =>
            {
                UIThread.Execute(() =>
                {
                    //  msgBox.Close();
                    var result = ev.Result;
                    actionWhenCompleted(result);
                });
            };

            test.RunSpeedTest();
        }
Exemplo n.º 2
0
        public static void TestConnection(Delegate del)
        {
            ConnectionTester.StartAsync((result) =>
            {
                if (result.Error == null)
                {
                    // TODO: Should we continue if the speed is too low? It won't be useful for the user anyway.
                    if (result.SpeedInMbps < 1)
                    {
                        PopupHelper.PopupMessage(DialogTitles.Warning, SR.SlowConnection, Labels.ButtonContinue, false);
                    }

                    SelectThrottleSettings(result);
                    del.DynamicInvoke(null);
                }
                else
                {
                    PopupHelper.PopupMessage(DialogTitles.Warning, SR.SpeedTestFailed, Labels.ButtonContinue, false);
                }
            });
        }
Exemplo n.º 3
0
        public static void StartAsync(Action<SpeedTestResult> actionWhenCompleted)
        {
           // ChildWindow msgBox = PopupHelper.PopupMessage(DialogTitles.Initializing, SR.CheckingConnectionSpeed);

            ConnectionTester test = new ConnectionTester();
            test.SpeedTestCompleted += (s, ev) =>
            {
                UIThread.Execute(() =>
                {
                  //  msgBox.Close();
                    var result = ev.Result;
                    actionWhenCompleted(result);
                });
            };

            test.RunSpeedTest();
        }