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)); }
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)); }
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)); }
protected abstract IExecutableRewriteSession RewriteSession(IParseManager parseManager, Func <IRewriteSession, bool> rewritingAllowed, out MockRewriterProvider mockProvider, bool rewritersAreDirty = false, ISelectionRecoverer selectionRecoverer = null);
protected override IRewriteSession RewriteSession(IParseManager parseManager, Func <IRewriteSession, bool> rewritingAllowed, out MockRewriterProvider mockProvider) { mockProvider = new MockRewriterProvider(); return(new CodePaneRewriteSession(parseManager, mockProvider, rewritingAllowed)); }
protected abstract IRewriteSession RewriteSession(IParseManager parseManager, Func <IRewriteSession, bool> rewritingAllowed, out MockRewriterProvider mockProvider, bool rewritersAreDirty = false);
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)); }