Exemplo n.º 1
0
        private IAnimationPipelineController Run(PipelineKind kind)
        {
            if (controller == null)
            {
                controller = new AnimationPipelineController <TOwner>(this);
                this.Kind  = kind;
                Run();

                return(controller);
            }
            else
            {
                throw new InvalidOperationException("You can call Once/Loop/PingPong just once by pipeline.");
            }
        }
Exemplo n.º 2
0
        private static IRunnablePipeline CreatePipeline(PipelineKind kind, DirectoryInfo inputDirectoryInfo, DirectoryInfo outputDirectoryInfo, DirectoryInfo recycleBin)
        {
            switch (kind)
            {
            case PipelineKind.Rename:
                return(new FileRenamerPipeline(inputDirectoryInfo, outputDirectoryInfo));

            case PipelineKind.Duplicate:
                return(new DuplicateMediaItemPipeline(inputDirectoryInfo, outputDirectoryInfo, recycleBin, new AverageHash()));

            case PipelineKind.Full:
                return(new FullMediaItemPipeline(inputDirectoryInfo, outputDirectoryInfo, recycleBin));

            default:
                throw new ArgumentOutOfRangeException(nameof(kind));
            }
        }