Пример #1
0
        public AppGroup(WindowExe exe)
        {
            App     = exe;
            Windows = new ObservableCollection <TimeSlot>();

            CvsWindows = new CollectionViewSource {
                Source = Windows
            };
            CvsWindows.Filter += ApplyFilter;
        }
Пример #2
0
        public void SetOrAddAppTime(WindowExe app, int lastAction, int timeInc = 1)
        {
            if (AppTimes.Any(o => o.App.Exe == app.Exe))
            {
                AppTimes.First(o => o.App.Exe == app.Exe).IncrementWindow(app.Title, lastAction, timeInc);
            }
            else
            {
                var nts = new AppGroup(app);
                nts.PropertyChanged += Nts_PropertyChanged;
                nts.IncrementWindow(app.Title, lastAction, timeInc);
                AppTimes.Add(nts);
            }

            PropChanged("IncludedTime");
            PropChanged("ExcludedTime");
            PropChanged("TotalTime");
        }
Пример #3
0
        public void SetOrAddAppTime(WindowExe app, int lastAction, int timeInc = 1)
        {
            if (AppTimes.Any(o => o.App.Exe == app.Exe))
            {
                AppTimes.First(o => o.App.Exe == app.Exe).IncrementWindow(app.Title, lastAction, timeInc);
                if (Properties.Settings.Default.Autosort)
                {
                    AppTimes.BubbleSort();
                }
            }
            else
            {
                app.LoadIcon();

                var nts = new AppGroup(app);
                nts.PropertyChanged += Nts_PropertyChanged;
                nts.IncrementWindow(app.Title, lastAction, timeInc);
                AppTimes.Add(nts);
            }

            PropChanged("IncludedTime");
            PropChanged("ExcludedTime");
            PropChanged("TotalTime");
        }
Пример #4
0
 public AppGroup(WindowExe exe)
 {
     App     = exe;
     Windows = new ObservableCollection <TimeSlot>();
 }