public FilterMCollection(ClockMCollection c) { MyClocks = c; Ms = new ObservableCollection <FilterM>(); Ms.CollectionChanged += Ms_CollectionChanged; }
public ClockGroupMCollection(ClockMCollection c) { Clocks = c; Ms = new ObservableCollection <ClockGroupM>(); Ms.CollectionChanged += Ms_CollectionChanged; }
public ClockGroupVMCollection(ClockMCollection cdc) { MyClockDataCollection = cdc; MyModel = new ClockGroupMCollection(MyClockDataCollection); MyModel.Ms.CollectionChanged += MyModel_CollectionChanged; VMs = new ObservableCollection <ClockGroupVM>(); VMs.CollectionChanged += VMs_CollectionChanged; }
public FilterVMCollection(ClockMCollection c) { MyClocks = c; MyModel = new FilterMCollection(MyClocks); MyModel.Ms.CollectionChanged += MyModel_Ms_CollectionChanged; VMs = new ObservableCollection <FilterVM>(); VMs.CollectionChanged += VMs_CollectionChanged; MyClocks.GroupsVM.VMs.CollectionChanged += GroupsVMs_CollectionChanged; OcPropertyChangedListener <ClockGroupVM> l1 = OcPropertyChangedListener.Create(MyClocks.GroupsVM.VMs); l1.PropertyChanged += l1_PropertyChanged; }
public void Init() { Model = new ClockMCollection(MyDataFile); Model.Init(); Model.IsUnsavedChanged += TimerCollection_IsDirtyChanged; Model.ClockPropertyChanged += Model_ClockPropertyChanged; Model.ClockAdded += Model_ClockAdded; Model.ClocksAdded += Model_ClocksAdded; Model.BeforeRemoveAllClocks += Model_BeforeRemoveAllClocks; // TODO: remove these: Model.TimerStartedByUser += Model_TimerStartedByUser; Model.TimerStopped += Model_TimerStopped; Model.TimerStoppedByUser += Model_TimerStoppedByUser; VMs = new ObservableCollection <ClockVM>(); VMs.CollectionChanged += VMs_CollectionChanged; Model.Ms.CollectionChanged += Ms_CollectionChanged; // TODO: keep the latest value of SelectedCount // and only trigger the property changed event // when the value changes (not on identical // consecutive values) SelectedClocks.CollectionChanged += SelectedClocks_CollectionChanged; //MySync = new ObservableCollectionSynchronizer<ClockM>(Model.Ms); //MySync.Synchronize(Model.Ms, new Func<ClockM, ClockVM>((ClockM m) => //{ // return //})); AlarmsTimer.Start(); }
internal FilterM(ClockMCollection cdc, string s = "") { Clocks = cdc; Groups = Clocks.Groups; List <string> l = s.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries).ToList(); if (l.Contains("active")) { ShowActive = true; ShowInactive = false; l.RemoveAll(x => x == "active"); } if (l.Contains("timers")) { ShowTimers = true; ShowAlarms = false; l.RemoveAll(x => x == "timers"); } if (l.Contains("inactive")) { ShowActive = false; ShowInactive = true; l.RemoveAll(x => x == "inactive"); } if (l.Contains("alarms")) { ShowTimers = false; ShowAlarms = true; l.RemoveAll(x => x == "alarms"); } foreach (string str in l) { if (string.IsNullOrWhiteSpace(str)) { continue; } try { int x = Convert.ToInt32(str); if (1 <= x && x <= Groups.Ms.Count) { //GroupIndices.Add(x); GroupNames.Add(Groups.Ms[x - 1].Name); } else { Autocorrected = true; } } catch (FormatException /*ex*/) { SearchString += str; continue; } } SearchString = SearchString.Trim(); }
public FilterVMCollection(ClockMCollection c) { MyClocks = c; MyModel = new FilterMCollection(MyClocks); }
public FilterMCollection(ClockMCollection c) { MyClocks = c; Ms = new ObservableCollection <FilterM>(); }