コード例 #1
0
ファイル: ViewModel.cs プロジェクト: Sidneys1/WorkClocker
        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");
        }