예제 #1
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");
        }
예제 #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);
                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");
        }