Exemplo n.º 1
0
        private void buttonLogOff_Click(object sender, RoutedEventArgs e)
        {
            WriteStatus("Disconnecting...");

            UpdateButtons(false);
            buttonLogOn.IsEnabled = false;

            radRegular.IsChecked = true;
            SwitchMode(AppMode.Regular);
            securityDefinitionGrid.Clear();

            fixApplication.StopFix();

            WriteStatus(String.Empty);
            fixApplication.Logon -= fixApplication_Logon;
            fixApplication.Logout -= fixApplication_Logout;
            fixApplication.OnTextAdded -= FixApplicationOnTextAdded;
            fixApplication = null;
        }
Exemplo n.º 2
0
        private void buttonLogOn_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                if (fixApplication != null)
                    buttonLogOff_Click(sender, e);

                WriteStatus("Connecting...");

                buttonLogOn.IsEnabled = false;
                fixApplication = new FixApplication(comboBoxConfigFile.Text);
            }
            catch(ThreadAbortException)
            {
                buttonLogOn.IsEnabled = true;
                throw;
            }
            catch (Exception)
            {
                buttonLogOn.IsEnabled = true;
                return;
            }
            finally
            {
                WriteStatus(String.Empty);
            }
            
            textBoxFIXConsole.Text = fixApplication.ConsoleText;
            fixApplication.OnTextAdded += FixApplicationOnTextAdded;
            fixApplication.Logon += fixApplication_Logon;
            fixApplication.Logout += fixApplication_Logout;
        }