コード例 #1
0
ファイル: SearchHelper.cs プロジェクト: Civa/Zenith
        internal static SearchOptionSegment CreateFromSearchOption(SearchOptionsItem item)
        {
            ISegmentPresenter<SearchOptionSegment> presenter = item as ISegmentPresenter<SearchOptionSegment>;

            if (presenter != null)
            {
                SearchOptionSegment segment = presenter.CreateSegment();
                ObservableCollection<SegmentPart> parts = item.CurrentView.CreateSegmentValues();

                segment.Parts = parts;
                return segment;
            }

            return null;
        }
コード例 #2
0
ファイル: SearchOptionsViewModel.cs プロジェクト: Civa/Zenith
        private void PopulateItems()
        {
            SearchOptionsItem coordinates = new SearchOptionsItem() { Caption = "Coordinates :", CurrentView = new CoordinatesViewModel(), CanAdd = true, CanModify = false };
            coordinates.PropertyChanged += SearchItem_PropertyChanged;

            SearchOptionsItem epoch = new SearchOptionsItem() { Caption = "Epoch :", CurrentView = new EpochViewModel(), CanAdd = true, CanModify = false, Kind = SearchOptionKind.Epoch };
            epoch.PropertyChanged += SearchItem_PropertyChanged;

            SearchOptionsItem equinox = new SearchOptionsItem() { Caption = "Equinox", CurrentView = new EquinoxViewModel(), CanAdd = true, CanModify = false, Kind = SearchOptionKind.Equinox };
            equinox.PropertyChanged += SearchItem_PropertyChanged;

            SearchOptionsItem radius = new SearchOptionsItem() { Caption = "Radius :", CurrentView = new RadiusViewModel(), CanAdd = true, CanModify = false, Kind = SearchOptionKind.Radius };
            radius.PropertyChanged += SearchItem_PropertyChanged;

            SearchOptionsItem objectName = new SearchOptionsItem() { Caption = "Object name :", CurrentView = new ObjectNameViewModel(), CanAdd = true, CanModify = false, Kind = SearchOptionKind.ObjectName };
            objectName.PropertyChanged += SearchItem_PropertyChanged;

            _items.Add(coordinates);
            _items.Add(epoch);
            _items.Add(equinox);
            _items.Add(radius);
            _items.Add(objectName);
        }
コード例 #3
0
ファイル: ObjectSearchViewModel.cs プロジェクト: Civa/Zenith
 private void UpdateSearchOptionSegment(SearchOptionsItem searchOption)
 {
     searchOption.CurrentView.UpdateSegmentValues();
     NotifyPropertyChanged(this, new PropertyChangedEventArgs("Segments"));
 }
コード例 #4
0
ファイル: ObjectSearchViewModel.cs プロジェクト: Civa/Zenith
 private void AddSearchOptionSegment(SearchOptionsItem searchOption)
 {
     SearchOptionSegment segment = SearchHelper.CreateFromSearchOption(searchOption);
     searchOption.CanModify = true;
     this._segments.Add(segment);
     NotifyPropertyChanged(this, new PropertyChangedEventArgs("Segments"));
 }