public EditorView(IViewContent content) { this.content = content; preview = new PreviewEditorView(content.Control.ToEto(), () => content?.WorkbenchWindow?.Document?.Editor?.Text); content.ContentChanged += content_ContentChanged; content.DirtyChanged += content_DirtyChanged; var commandRouterContainer = new CommandRouterContainer(preview.ToNative(true), content, true); commandRouterContainer.Show(); control = commandRouterContainer; IdeApp.Workbench.ActiveDocumentChanged += Workbench_ActiveDocumentChanged; base.ContentName = content.ContentName; }
/// <summary> /// Constructor that calls the Microsoft.VisualStudio.Shell.WindowPane constructor then /// our initialization functions. /// </summary> /// <param name="package">Our Package instance.</param> public EtoPreviewPane(EtoAddinPackage package, string fileName, IVsTextLines textBuffer) : base(package) { this.package = package; this.textBuffer = textBuffer; FileName = fileName; editorControl = new Panel(); preview = new PreviewEditorView(editorControl, () => textBuffer?.GetText()); if (!preview.SetBuilder(fileName)) { throw new InvalidOperationException(string.Format("Could not find builder for file {0}", fileName)); } Content = preview.ToNative(true); }
/// <summary> /// Constructor that calls the Microsoft.VisualStudio.Shell.WindowPane constructor then /// our initialization functions. /// </summary> /// <param name="package">Our Package instance.</param> public EtoPreviewPane(EtoAddinPackage package, string fileName, IVsTextLines textBuffer, string mainAssembly, IEnumerable <string> references) : base(package) { this.package = package; this.textBuffer = textBuffer; FileName = fileName; editorControl = new Panel(); preview = new PreviewEditorView(editorControl, mainAssembly, references, () => textBuffer?.GetText()); preview.GotFocus += (sender, e) => { wpfViewHost?.TextView?.VisualElement?.Focus(); }; if (!preview.SetBuilder(fileName)) { throw new InvalidOperationException(string.Format("Could not find builder for file {0}", fileName)); } var content = preview.ToNative(true); Content = content; }