Ejemplo n.º 1
0
        // callback of async settings test
        private void TestSettingsCallback(IAsyncResult ar)
        {
            TestSettingsAsync  caller = (TestSettingsAsync)ar.AsyncState;
            TestSettingsResult result = caller.EndInvoke(ar);

            // check the result of the settings test
            if (result != TestSettingsResult.Success)
            {
                if (result == TestSettingsResult.Timeout)
                {
                    FireStatus(Strings.Timeout);
                }
                else if (result == TestSettingsResult.InvalidLogin)
                {
                    FireStatus(Strings.InvalidLogin);
                }
                else if (result == TestSettingsResult.InvalidDirectory)
                {
                    FireStatus(Strings.InvalidDirectory);
                }

                // fire some events
                ResetInterface();
            }
            else
            {
                Init();
            }
        }
Ejemplo n.º 2
0
        // tests settings (serverpath & login)
        public void Start()
        {
            connected = false;
            versions.Clear();

            // try to get the settings from settings object
            if (!Settings.Loaded && !Settings.LoadSettings())
            {
                FireStatus(Strings.NoSettingsFound);
            }
            else
            {
                FireStatus(Strings.Connecting);

                // test settings async
                var caller = new TestSettingsAsync(Settings.TestSettings);
                caller.BeginInvoke(new AsyncCallback(TestSettingsCallback), caller);
            }
        }
Ejemplo n.º 3
0
        // tests settings (serverpath & login)
        public void Start()
        {
            connected = false;
            versions.Clear();

            // try to get the settings from settings object
            if (!Settings.Loaded && !Settings.LoadSettings())
                FireStatus(Strings.NoSettingsFound);
            else
            {
                FireStatus(Strings.Connecting);

                // test settings async
                var caller = new TestSettingsAsync(Settings.TestSettings);
                caller.BeginInvoke(new AsyncCallback(TestSettingsCallback), caller);
            }
        }