Exemple #1
0
        public MainWindow()
        {
            InitializeComponent();

            //driver = new SwingTradeDriver();
            driver = new DayTradeDriver();

            driver.Connect(this);

            foreach (var sessionId in driver.GetSessions())
                sessionsCombo.Items.Add(sessionId);

            sessionsCombo.SelectedItem = sessionsCombo.Items.Cast<SessionID>().First();
        }
        private void SetDriver(object selectedItem)
        {
            var item = selectedItem as ComboBoxItem;

            if (item == null || item.Content == null) return;

            if (currentDriver != null)
                currentDriver.Disconnect();

            currentDriver = drivers[item.Content.ToString()];

            currentDriver.Connect(this);

            sessionsCombo.Items.Clear();

            foreach (var sessionId in currentDriver.GetSessions())
                sessionsCombo.Items.Add(sessionId);

            sessionsCombo.SelectedItem = sessionsCombo.Items.Cast<SessionID>().First();
        }