示例#1
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());
            }
        }
 public void SetUp()
 {
     screenShooter = new ScreenShooter();
 }