Exemplo n.º 1
0
 /// <summary>
 /// get the initial list of engines from the ISS server
 /// we do not care about cookies here because general data is always available to everyone
 /// </summary>
 private void Btn_engines_OnClick(object sender, RoutedEventArgs e)
 {
     if (_myClient == null)
     {
         _myClient = new MicexISSClient();
     }
     GetButton.IsEnabled = false;
     EngineListbox.Items.Clear();
     _myClient.GetEngines(_myHandler);
     foreach (var row in _myHandler.EnginesStorage)
     {
         EngineListbox.Items.Add(row.Value);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// perform one attempt to authenticate
        /// </summary>
        private void Btn_auth_OnClick(object sender, RoutedEventArgs e)
        {
            _myAuth = new MicexAuth(UsernameTextBox.Text, PasswordBox.Password);
            var st = "Result:";

            st = st + Environment.NewLine + "Status Code: " + _myAuth.LastStatus;
            st = st + Environment.NewLine + "Status Text: " + _myAuth.LastStatusText;
            st = st + Environment.NewLine + "Real-time: " + _myAuth.IsRealTime();
            AuthTextBox.Text = st;
            if (_myAuth.LastStatus == HttpStatusCode.OK)
            {
                if (BoardListbox.SelectedItems.Count == 1)
                {
                    GetButton.IsEnabled = true;
                }
                _myClient = new MicexISSClient(_myAuth.Cookiejar);
            }
            else
            {
                GetButton.IsEnabled = false;
            }
        }