Beispiel #1
0
        /// <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, CodeEditorHost codeEditor)
            : base(package)
        {
            this.editor     = codeEditor;
            this.package    = package;
            this.textBuffer = textBuffer;
            FileName        = fileName;

            editorControl         = new Panel();
            editorControl.Content = editor.wpfElement.ToEto();

            previewSplitter           = new PreviewEditorViewSplitter(editorControl, mainAssembly, references, () => textBuffer?.GetText());
            previewSplitter.GotFocus += (sender, e) =>
            {
                WpfTextView?.VisualElement?.Focus();
            };
            preview = previewSplitter.Preview;

            var content = previewSplitter.ToNative(true);

            if (!preview.SetBuilder(fileName))
            {
                throw new InvalidOperationException(string.Format("Could not find builder for file {0}", fileName));
            }
            Content = content;
        }
Beispiel #2
0
        /// <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);
        }
Beispiel #3
0
 public EditorFactory(EtoAddinPackage package)
 {
     this.editorPackage = package;
 }
Beispiel #4
0
		public EditorFactory(EtoAddinPackage package)
		{
			this.editorPackage = package;
		}