Beispiel #1
0
        public void AddPauseExecute()
        {
            var newRange = new RangeViewModel(this);

            newRange.RangeType = RangeType.Pause;
            if (m_rangeView == null)
            {
                m_rangeView = new ObservableCollection <RangeViewModel>();
                //newRange.RangeId = 1;
            }
            ////else
            ////{
            ////    if (m_rangeView.Count > 0)
            ////    {
            ////        newRange.RangeId = m_rangeView.Max(r => r.RangeId) + 1;
            ////    }
            ////    else
            ////    {
            ////        newRange.RangeId = 1;
            ////    }
            ////}

            newRange.RangeId = OrionRangeIdHelper.GetNextRangeId();

            m_rangeView.Add(newRange);
            this.OnPropertyChanged("RangeViews");
            this.OnPropertyChanged("RangeVisible");
            this.OnPropertyChanged("SortedRanges");
        }
Beispiel #2
0
        public void AddRangeExecute()
        {
            var newRange = new RangeViewModel();

            newRange.RangeType = RangeType.Shooting;
            if (m_rangeView == null)
            {
                m_rangeView      = new ObservableCollection <RangeViewModel>();
                newRange.RangeId = 1;
            }
            else
            {
                newRange.RangeId = m_rangeView.Max(r => r.RangeId) + 1;
            }

            m_rangeView.Add(newRange);
            this.OnPropertyChanged("RangeViews");
            this.OnPropertyChanged("RangeVisible");
        }