コード例 #1
0
 protected override IExecutableRewriteSession RewriteSession(IParseManager parseManager, Func <IRewriteSession, bool> rewritingAllowed, out MockRewriterProvider mockProvider, bool rewritersAreDirty = false, ISelectionRecoverer selectionRecoverer = null)
 {
     if (selectionRecoverer == null)
     {
         selectionRecoverer = new Mock <ISelectionRecoverer>().Object;
     }
     mockProvider = new MockRewriterProvider(rewritersAreDirty);
     return(new CodePaneRewriteSession(parseManager, mockProvider, selectionRecoverer, rewritingAllowed));
 }
コード例 #2
0
        protected IExecutableRewriteSession RewriteSession(Func <IRewriteSession, bool> rewritingAllowed,
                                                           out MockRewriterProvider mockProvider, bool rewritersAreDirty = false, ISelectionRecoverer selectionRecoverer = null)
        {
            var parseManager = new Mock <IParseManager>();

            parseManager.Setup(m => m.OnSuspendParser(It.IsAny <object>(), It.IsAny <IEnumerable <ParserState> >(), It.IsAny <Action>(), It.IsAny <int>()))
            .Callback((object requestor, IEnumerable <ParserState> allowedStates, Action suspendAction, int timeout) => suspendAction())
            .Returns((object requestor, IEnumerable <ParserState> allowedStates, Action suspendAction, int timeout) => new SuspensionResult(SuspensionOutcome.Completed));
            return(RewriteSession(parseManager.Object, rewritingAllowed, out mockProvider, rewritersAreDirty, selectionRecoverer));
        }
コード例 #3
0
        protected IRewriteSession RewriteSession(Func <IRewriteSession, bool> rewritingAllowed,
                                                 out MockRewriterProvider mockProvider)
        {
            var parseManager = new Mock <IParseManager>();

            parseManager.Setup(m => m.OnSuspendParser(It.IsAny <object>(), It.IsAny <IEnumerable <ParserState> >(), It.IsAny <Action>(), It.IsAny <int>()))
            .Callback((object requestor, IEnumerable <ParserState> allowedStates, Action suspendAction, int timeout) => suspendAction())
            .Returns((object requestor, IEnumerable <ParserState> allowedStates, Action suspendAction, int timeout) => SuspensionResult.Completed);
            return(RewriteSession(parseManager.Object, rewritingAllowed, out mockProvider));
        }
コード例 #4
0
 protected abstract IExecutableRewriteSession RewriteSession(IParseManager parseManager, Func <IRewriteSession, bool> rewritingAllowed, out MockRewriterProvider mockProvider, bool rewritersAreDirty = false, ISelectionRecoverer selectionRecoverer = null);
コード例 #5
0
 protected override IRewriteSession RewriteSession(IParseManager parseManager, Func <IRewriteSession, bool> rewritingAllowed, out MockRewriterProvider mockProvider)
 {
     mockProvider = new MockRewriterProvider();
     return(new CodePaneRewriteSession(parseManager, mockProvider, rewritingAllowed));
 }
コード例 #6
0
 protected abstract IRewriteSession RewriteSession(IParseManager parseManager, Func <IRewriteSession, bool> rewritingAllowed, out MockRewriterProvider mockProvider, bool rewritersAreDirty = false);
コード例 #7
0
 protected override IRewriteSession RewriteSession(IParseManager parseManager, Func <IRewriteSession, bool> rewritingAllowed, out MockRewriterProvider mockProvider, bool rewritersAreDirty = false)
 {
     mockProvider = new MockRewriterProvider(rewritersAreDirty);
     return(new AttributesRewriteSession(parseManager, mockProvider, rewritingAllowed));
 }