Ejemplo n.º 1
0
 /// <summary>
 /// Releases all static instances.
 /// </summary>
 public static void Clear()
 {
     mediaInfo      = null;
     mediaEncoder   = null;
     mediaMuxer     = null;
     processFactory = null;
 }
Ejemplo n.º 2
0
 public static ProcessManager.IGiven ForProcess <TProcess>(
     IProcessManagerFactory factory = null,
     string processId = null,
     [CallerMemberName] string scenarioName = null)
     where TProcess : IProcessManager
 {
     return(new ProcessManager.ScenarioBuilder <TProcess>(factory, processId, scenarioName));
 }
Ejemplo n.º 3
0
        public MainWindow()
        {
            InitializeComponent();
            ffmpegManagerUI = new FFmpegUserInterfaceManager(this);
            factory         = new ProcessManagerFactory(Properties.Settings.Default.FFmpegPath, ffmpegManagerUI);
            encoder         = new MediaEncoder(factory);
            muxer           = new MediaMuxer(factory);

            //FFmpegProcess ffmpeg = new FFmpegProcess();
            //var status = ffmpeg.RunFFmpeg("-version");
        }
Ejemplo n.º 4
0
 public ProcessManagerDispatcher(
     DispatchCommand dispatchCommand,
     IProcessManagerCheckpointRepository <TCheckpoint> checkpointRepository,
     IProcessManagerFactory processManagerFactory = null,
     BuildProcessManagerId buildProcessId         = null)
 {
     _checkpointRepository  = checkpointRepository;
     _dispatchCommand       = dispatchCommand;
     _processManagerFactory = processManagerFactory ?? new DefaultProcessManagerFactory();
     _buildProcessId        = buildProcessId ?? DefaultBuildProcessManagerId;
     _byCorrelationId       = new Dictionary <Type, Func <object, string> >();
     _activeProcesses       = new ConcurrentDictionary <string, CheckpointedProcess>();
 }
Ejemplo n.º 5
0
 public static ProcessHandler <TProcess, TCheckpoint> For <TProcess, TCheckpoint>(
     DispatchCommand dispatchCommand,
     IProcessManagerCheckpointRepository <TCheckpoint> checkpointRepository,
     IProcessManagerFactory processManagerFactory = null,
     ProcessHandler <TProcess, TCheckpoint> .BuildProcessManagerId buildProcessId = null)
     where TProcess : IProcessManager
     where TCheckpoint : IComparable <string>
 {
     return(new ProcessHandler <TProcess, TCheckpoint>(
                dispatchCommand,
                checkpointRepository,
                processManagerFactory,
                buildProcessId));
 }
        public void ProcessWrapperFactoryCtorTest()
        {
            IProcessManagerFactory factory = null;

            try
            {
                factory = new ProcessManagerFactory(null);
                Assert.True(false, "Should fail on previous statement");
            }
            catch (Exception ex)
            {
                Assert.IsType(typeof(ArgumentNullException), ex);
                Assert.Equal("Value cannot be null.\r\nParameter name: processProxy", ex.Message);
            }

            var proxy = new Mock <IProcessProxy>();

            factory = new ProcessManagerFactory(proxy.Object);
            Assert.NotNull(factory);
        }
Ejemplo n.º 7
0
                public ScenarioBuilder(IProcessManagerFactory factory, string correlationId, string name)
                {
                    _processId        = typeof(TProcess).Name + "-" + correlationId;
                    _correlationId    = correlationId;
                    _name             = name;
                    _factory          = factory ?? new DefaultProcessManagerFactory();
                    _given            = new object[0];
                    _expectedCommands = new object[0];
                    _expectedEvents   = new object[0];

                    _runGiven = process =>
                    {
                        foreach (var message in _given.Select(WrapInEnvelopeIfNecessary))
                        {
                            process.Inbox.OnNext(message);
                        }
                    };

                    _runWhen = process =>
                    {
                        process.Inbox.OnNext(WrapInEnvelopeIfNecessary(new CheckpointReached()));

                        process.Inbox.OnNext(WrapInEnvelopeIfNecessary(_when));
                    };

                    _checkCommands = _ => { };
                    _checkEvents   = _ => { };

                    _runThen = process =>
                    {
                        _checkCommands(process);
                        _checkEvents(process);
                    };

                    _timer = new Stopwatch();
                }
Ejemplo n.º 8
0
 public MediaInfo(IProcessManagerFactory processFactory)
 {
     this.factory = processFactory ?? throw new ArgumentNullException(nameof(processFactory));
 }
Ejemplo n.º 9
0
 public MediaMuxer(IProcessManagerFactory processFactory, IFileSystemService fileSystemService)
 {
     this.factory    = processFactory ?? throw new ArgumentNullException(nameof(processFactory));
     this.fileSystem = fileSystemService ?? throw new ArgumentNullException(nameof(fileSystemService));
 }
Ejemplo n.º 10
0
 public MediaMuxer(IProcessManagerFactory processFactory) : this(processFactory, new FileSystemService())
 {
 }
Ejemplo n.º 11
0
 private IMediaMuxer SetupMuxer()
 {
     factory = new ProcessManagerFactory(Properties.Settings.Default.FFmpegPath);
     return(new MediaMuxer(factory));
 }
Ejemplo n.º 12
0
 public WalletProvider(IProcessManagerFactory processManagerFactory, ILogger <IWalletProvider> logger)
 {
     this.logger = logger;
     this.processManagerFactory = processManagerFactory;
 }