예제 #1
0
        void TsWinLoggerAppChanged(object sender, WindowTracker.ActApplicationChangedHandlerArgs args)
        {
            var currApp = _applicationList.Find(a =>
                                                a.Name == args.NewPname && a.Description == args.NewPdesc);

            if (currApp != null)
            {
                if (currApp.PID != args.NewPID)
                {
                    currApp.StartTime = DateTime.Now;
                    currApp.PID       = args.NewPID;
                }
            }
            else
            {
                var app = new TsApplication(args.NewPname, args.NewPdesc, args.NewPID)
                {
                    StartTime = DateTime.Now
                };
                app.SmallIcon = IconHelper.GetApplicationIcon(app.Name, app.Description, false).ToBitmap();
                app.LargeIcon = IconHelper.GetApplicationIcon(app.Name, app.Description, true).ToBitmap();
                _taskDbs.NewApplication(app);
                _applicationList.Add(app);
                InvokeNewApplication(new TsApplication.NewApplicationHandlerArgs(app));
            }
        }
예제 #2
0
 public void InvokeAppChanged(WindowTracker.ActApplicationChangedHandlerArgs args)
 {
     WindowTracker.ActApplicationChangedHandler handler = AppChanged;
     if (handler != null)
     {
         handler(this, args);
     }
 }
예제 #3
0
 void WinTrackerActApplicationChanged(object sender, WindowTracker.ActApplicationChangedHandlerArgs args)
 {
     InvokeAppChanged(args);
 }