Exemplo n.º 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(EtoPreviewPackage package, string fileName, IVsTextLines textBuffer)
            : base(null)
        {
            this.package    = package;
            this.textBuffer = textBuffer;
            FileName        = fileName;

            builderInfo = BuilderInfo.Find(fileName);
            if (builderInfo == null)
            {
                throw new Exception(string.Format("Could not find builder for file {0}", fileName));
            }
            builder = builderInfo.CreateBuilder();

            SetupCommands();
        }
Exemplo n.º 2
0
        void ViewDesigner(ITextDocument document)
        {
            var builderInfo = BuilderInfo.FindCodeBehind(document.FilePath);

            if (builderInfo == null)
            {
                return;
            }
            var codeFile = builderInfo.GetDesignFile(document.FilePath);

            if (!File.Exists(codeFile))
            {
                return;
            }

            IVsWindowFrame frame;
            IVsUIHierarchy hierarchy;
            uint           itemid;

            VsShellUtilities.OpenDocumentWithSpecificEditor(ServiceProvider, codeFile, Constants.EtoPreviewEditorFactory_guid, VSConstants.LOGVIEWID.Primary_guid, out hierarchy, out itemid, out frame);
            ErrorHandler.ThrowOnFailure(frame.Show());
        }