public void TypeFilter(ObservableCollection <EntityShow> list, Type filterType, string filter) { list.Clear(); if (filterType == null) { AllEntityList.ForEach(v => { if (IsFit(v, filter)) { list.Add(v); } }); } else { AllEntityList.ForEach(v => { if (v.GetType().GetTypeInfo().IsSubclassOf(filterType)) { if (IsFit(v, filter)) { list.Add(v); } } }); } }
public void Init() { foreach (var v in MainViewModel.mainViewModel.ActorList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowEntityList.Add(e); } foreach (var v in MainViewModel.mainViewModel.EventList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowEntityList.Add(e); } foreach (var v in MainViewModel.mainViewModel.GroupList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowEntityList.Add(e); } foreach (var v in MainViewModel.mainViewModel.LocationList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowEntityList.Add(e); } foreach (var v in MainViewModel.mainViewModel.StuffList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowEntityList.Add(e); } foreach (var v in MainViewModel.mainViewModel.TaskList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowEntityList.Add(e); } OnPropertyChanged("TotalNo"); }
public List <IStoryEntityObject> GetSelected() { var l = new List <IStoryEntityObject>(); foreach (var e in AllEntityList.Where(v => v.IsSelected)) { l.Add(e.Target); } return(l); }
//public string Filter //{ // get { return _Filter; } // set // { // if (_Filter != value) // { // ShowEntityList.Clear(); // AllEntityList.ForEach(v => // { // if (IsFit(v)) // ShowEntityList.Add(v); // }); // } // _Filter = value; // OnPropertyChanged("Filter"); // } //} public void Filter(string filter) { _Filter = filter; ShowEntityList.Clear(); AllEntityList.ForEach(v => { if (IsFit(v, filter)) { ShowEntityList.Add(v); } }); }
public void Init() { foreach (var v in MainViewModel.mainViewModel.ActorList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowSourceEntityList.Add(e); ShowTargetEntityList.Add(e); } foreach (var v in MainViewModel.mainViewModel.EventList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowSourceEntityList.Add(e); ShowTargetEntityList.Add(e); } foreach (var v in MainViewModel.mainViewModel.GroupList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowSourceEntityList.Add(e); ShowTargetEntityList.Add(e); } foreach (var v in MainViewModel.mainViewModel.LocationList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowSourceEntityList.Add(e); ShowTargetEntityList.Add(e); } foreach (var v in MainViewModel.mainViewModel.StuffList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowSourceEntityList.Add(e); ShowTargetEntityList.Add(e); } foreach (var v in MainViewModel.mainViewModel.TaskList) { var e = new EntityShow() { Target = v.TargetObject, IconImage = v.IconImage }; AllEntityList.Add(e); ShowSourceEntityList.Add(e); ShowTargetEntityList.Add(e); } RelationTypeList.ForEach(v => ShowRelationTypeList.Add(v)); }
public void ClearSelect() { AllEntityList.ForEach(v => v.IsSelected = false); }