public void SetUp()
 {
     configuration = new RecordConfiguration()
     {
         Name = "Name",
         Path = "Path",
         Period = 1000
     };
 }
        public ProcessRecorder(RecordConfiguration configuration, ProcessCaptureValidator validator, IScreenShooter screenShooter)
        {
            Period = configuration.Period;
            RecordName = configuration.Name;
            Path = configuration.StoragePath;
            NumCaptures = 0;
            this.validator = validator;
            this.screenShooter = screenShooter;

            initTimer();
        }
示例#3
0
        public static void Main(string[] args)
        {
            ICommandLineParser parser = new CommandLineParser();
            LineCommandOptions options = new LineCommandOptions();
            if (parser.ParseArguments(args, options))
            {
                if (ValidateOptions(options))
                {
                    int second = 1000;
                    int fps = 12;
                    IList<string> processes = options.Processes;

                    RecordConfiguration configuration = new RecordConfiguration()
                    {
                        Name = options.RecordName,
                        Path = options.Path,
                        Period = second / fps
                    };

                    RecordStorageManager storageManager = new RecordStorageManager();
                    storageManager.SetRecordDirectory(configuration.StoragePath);
                    IProcessHandler processHandler = new ProcessHandler();
                    IScreenShooter screenShooter = new ScreenShooter();
                    ProcessCaptureValidator validator = new ProcessCaptureValidator(processHandler, processes);
                    ProcessRecorder processRecorder = new ProcessRecorder(configuration, validator, screenShooter);

                    processRecorder.Start();
                    Console.WriteLine("Recording...");
                    Console.WriteLine("Press the Enter to stop recording.");
                    Console.ReadLine();
                    processRecorder.Stop();
                }
            }
            else
            {
                Console.WriteLine(options.GetUsage());
            }
        }