Beispiel #1
0
 private RazorCodeGenerator(Microsoft.VisualStudio.Text.ITextBuffer buffer, Version razorVersion, string physicalPath, string virtualPath)
 {
     WebEditor.CompositionService.SatisfyImportsOnce(this);
     _parseData                        = new ParseData();
     _viewBuffer                       = buffer;
     _viewBuffer.Changed              += TextBuffer_OnChanged;
     _viewBuffer.PostChanged          += TextBuffer_OnPostChanged;
     _htmlDocument                     = ServiceManager.GetService <HtmlEditorDocument>(_viewBuffer);
     _htmlDocument.OnDocumentClosing  += OnClose;
     _htmlDocument.MassiveChangeEnded += OnMassiveChangeEnded;
     _fullPath = ((!string.IsNullOrEmpty(physicalPath)) ? physicalPath : "Default.cshtml");
     if (virtualPath == null)
     {
         virtualPath = "Default.cshtml";
     }
     _runtimeError      = new RazorRuntimeError(_viewBuffer);
     _razorEditorParser = new ShimRazorEditorParserImpl(virtualPath, _fullPath);
     _razorEditorParser.DocumentParseComplete += DocumentParseComplete;
     ReparseFile();
     WebEditor.OnIdle += OnFirstIdle;
     ServiceManager.AddService(this, _viewBuffer);
     ServiceManager.AddService <IRazorCodeGenerator>(this, _viewBuffer);
     ServiceManager.AddService <IContainedCodeGenerator>(this, _viewBuffer);
 }
		private RazorCodeGenerator(Microsoft.VisualStudio.Text.ITextBuffer buffer, Version razorVersion, string physicalPath, string virtualPath)
		{
			WebEditor.CompositionService.SatisfyImportsOnce(this);
			_parseData = new ParseData();
			_viewBuffer = buffer;
			_viewBuffer.Changed += TextBuffer_OnChanged;
			_viewBuffer.PostChanged += TextBuffer_OnPostChanged;
			_htmlDocument = ServiceManager.GetService<HtmlEditorDocument>(_viewBuffer);
			_htmlDocument.OnDocumentClosing += OnClose;
            _htmlDocument.MassiveChangeEnded += OnMassiveChangeEnded;
			_fullPath = ((!string.IsNullOrEmpty(physicalPath)) ? physicalPath : "Default.cshtml");
			if (virtualPath == null)
			{
				virtualPath = "Default.cshtml";
			}
			_runtimeError = new RazorRuntimeError(_viewBuffer);
			_razorEditorParser = new ShimRazorEditorParserImpl(virtualPath, _fullPath);
			_razorEditorParser.DocumentParseComplete += DocumentParseComplete;
			ReparseFile();
			WebEditor.OnIdle += OnFirstIdle;
			ServiceManager.AddService(this, _viewBuffer);
			ServiceManager.AddService<IRazorCodeGenerator>(this, _viewBuffer);
			ServiceManager.AddService<IContainedCodeGenerator>(this, _viewBuffer);
		}