Exemplo n.º 1
0
 protected override void OnContentNameChanged()
 {
     base.OnContentNameChanged();
     content.ContentName = ContentName;
     Preview.SetBuilder(ContentName);
     Preview.Update();
 }
Exemplo n.º 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, 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;
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
 public override void Load(string fileName)
 {
     preview.SetBuilder(fileName);
     content.Load(fileName);
     base.ContentName = fileName;
 }