Ejemplo n.º 1
0
        private static void Init(string[] args)
        {
            processor = new Processor
            {
                InputFilenames = args.Take(args.Length - 1).ToArray(),
                OutputDirectory = args.Last(),
                UpdateInterval = 250,
                Priority = ProcessPriorityClass.Normal
            };
            processor.PreparationCompleted += processor_PreparationCompleted;
            processor.PreparationCanceled += processor_PreparationCanceled;
            processor.ConversionCompleted += processor_ConversionCompleted;
            processor.ConversionCanceled += processor_ConversionCanceled;
            processor.ConversionUpdated += processor_ConversionUpdated;

            processorFinishedEvent = new ManualResetEvent(false);

            updateAvailabilityLock = new object();
            updateAvailability = true;

            Console.CancelKeyPress += Console_CancelKeyPress;
        }
Ejemplo n.º 2
0
        private void InitializeProcessor(IEnumerable<string> inputFilenames, string outputDirectory)
        {
            processor = new Processor
            {
                InputFilenames = inputFilenames,
                OutputDirectory = outputDirectory,
                UpdateInterval = 250
            };

            processor.PreparationCompleted += (s, e) => this.TryInvoke(processor_PreparationCompleted, s, e);
            processor.PreparationCanceled += (s, e) => this.TryInvoke(processor_PreparationCanceled, s, e);
            processor.ConversionUpdated += (s, e) => this.TryInvoke(processor_ConversionUpdated, s, e);
            processor.ConversionCompleted += (s, e) => this.TryInvoke(processor_ConversionCompleted, s, e);
            processor.ConversionCanceled += (s, e) => this.TryInvoke(processor_ConversionCanceled, s, e);
        }