Ejemplo n.º 1
0
        private void ExchangeComboBox_OnSelectedIndexChanged(object sender, RoutedEventArgs e)
        {
            if (TheInstrument.SessionsSource == SessionsSource.Exchange)
            {
                SelectedSessions.Clear();

                foreach (ExchangeSession s in TheInstrument.Exchange.Sessions)
                {
                    SelectedSessions.Add(s.ToInstrumentSession());
                }
            }
        }
Ejemplo n.º 2
0
        private void FillSessionsFromTemplate()
        {
            SelectedSessions.Clear();

            var template = (SessionTemplate)TemplateComboBox.SelectedItem;

            if (template == null)
            {
                TheInstrument.SessionTemplateID = -1; //we can check for this later and deny the new instrument if its sessions are not set properly
                return;
            }

            TheInstrument.SessionTemplateID = template.ID;
            foreach (TemplateSession s in template.Sessions.OrderBy(x => x.OpeningDay))
            {
                SelectedSessions.Add(s.ToInstrumentSession());
            }
        }
Ejemplo n.º 3
0
        private void ExchangeRadioBtn_Checked(object sender, RoutedEventArgs e)
        {
            if (TheInstrument.Exchange == null)
            {
                return;
            }
            if (TheInstrument.SessionsSource == SessionsSource.Exchange)
            {
                return;                                                          //we don't want to re-load them if it's already set
            }
            SelectedSessions.Clear();
            TheInstrument.SessionsSource = SessionsSource.Exchange;

            foreach (ExchangeSession s in TheInstrument.Exchange.Sessions)
            {
                SelectedSessions.Add(s.ToInstrumentSession());
            }
        }