コード例 #1
0
        public virtual void before_each()
        {
            autoSubstitute = new AutoSubstitute();

            solutionOpenedStream  = new Subject <SolutionInfo>();
            solutionClosingStream = new Subject <Unit>();
            projectAddedStream    = new Subject <ProjectInfo>();
            projectRemovingtream  = new Subject <ProjectInfo>();

            var solutionNotifier = autoSubstitute.Resolve <ISolutionNotifier>();

            solutionNotifier.SolutionOpenedStream.Returns(solutionOpenedStream);
            solutionNotifier.SolutionClosingStream.Returns(solutionClosingStream);
            solutionNotifier.ProjectAddedStream.Returns(projectAddedStream);
            solutionNotifier.ProjectRemovingtream.Returns(projectRemovingtream);

            projectEnumerator = autoSubstitute.Resolve <IProjectEnumerator>();

            notifier = autoSubstitute.Resolve <ProjectNotifier>();

            testProjectObserver = new TestScheduler().CreateObserver <IEnumerable <ProjectInfo> >();

            subscription = notifier.ProjectStream.Subscribe(testProjectObserver);

            someSolution = new SolutionInfo();

            someProjectInfos = new []
            {
                new ProjectInfo(),
                new ProjectInfo(),
                new ProjectInfo(),
            };
        }
コード例 #2
0
        public void OnExecute(CommandEventArgs e)
        {
            if (_commandService == null)
                _commandService = e.GetService<IVisualGitCommandService>();
            if (_projectNotifier == null)
                _projectNotifier = e.GetService<ProjectNotifier>(typeof(IFileStatusMonitor));

            _commandService.TockCommand(e.Command);

            _projectNotifier.HandleEvent(e.Command);
        }
コード例 #3
0
ファイル: MarkProjectDirty.cs プロジェクト: windygu/AnkhSVN
        public void OnExecute(CommandEventArgs e)
        {
            if (_commandService == null)
            {
                _commandService = e.GetService <IAnkhCommandService>();
            }
            if (_projectNotifier == null)
            {
                _projectNotifier = e.GetService <ProjectNotifier>(typeof(IFileStatusMonitor));
            }

            _commandService.TockCommand(e.Command);

            _projectNotifier.HandleEvent(e.Command);
        }