Esempio n. 1
0
        public RangeViewModel(OrionViewModel parent)
        {
            this.CommunicationSetup = new CommunicationSetup();
            m_parent         = parent;
            m_countingShoots = 6;
            var counting = ConfigurationLoader.GetAppSettingsValue("DefaultCountingShoots");

            if (!string.IsNullOrWhiteSpace(counting))
            {
                int shots = 0;
                if (int.TryParse(counting, out shots))
                {
                    m_countingShoots = shots;
                }
            }
        }
Esempio n. 2
0
        public void NewOrionExecute()
        {
            if (m_orionViewModels == null)
            {
                m_orionViewModels = new ObservableCollection <OrionViewModel>();
            }

            var newOrion = new OrionViewModel();

            if (m_orionViewModels.Any())
            {
                newOrion.OrionId = m_orionViewModels.Max(o => o.OrionId) + 1;
            }
            else
            {
                newOrion.OrionId = 1;
            }

            m_orionViewModels.Add(newOrion);
            this.OnPropertyChanged("OrionViewModels");
            this.OnPropertyChanged("OrionVisible");
        }