示例#1
0
        public void Process(MyArgs args, ICounter counter, IRemover remover,
                            IReverser reverser, IFileBrowser browser) //Method injection
        {
            while (true)
            {
                if (args.FilePath != null)
                {
                    if (args.Remove)
                    {
                        remover.RemoveWord(args);
                    }

                    if (args.ShowTen)
                    {
                        counter.CountWords(args);
                    }

                    if (args.ReverseSentence)
                    {
                        reverser.ReverseSentence(args, 3);
                    }
                }

                if (args.DirPath != null)
                {
                    if (browser.ShowContent(args.DirPath, args))
                    {
                        continue;
                    }
                }

                break;
            }
        }
示例#2
0
文件: Dare.cs 项目: ggrov/tacny
 public DareController(Program program, IRemover remover)
 {
     Contract.Requires(program != null);
     Program = program;
     if (!IsProgramValid())
         throw new NotValidException();
     var removalTypeFinder = new RemovableTypeFinder(program);
     AllRemovableTypes = removalTypeFinder.FindRemovables();
     Remover = remover;
 }
示例#3
0
        public DareController(Program program, IRemover remover)
        {
            Contract.Requires(program != null);
            Program = program;
            if (!IsProgramValid())
            {
                throw new NotValidException();
            }
            var removalTypeFinder = new RemovableTypeFinder(program);

            AllRemovableTypes = removalTypeFinder.FindRemovables();
            Remover           = remover;
        }
示例#4
0
 public Translator(IPhoneTypeDetector phoneTypeDetector, IRemover remover)
 {
     this.phoneTypeDetector = phoneTypeDetector;
     this.remover           = remover;
 }
示例#5
0
 public RemoveCommand(IRemover remover, IBlobsListing listing)
 {
     this.remover = remover;
     this.listing = listing;
 }