示例#1
0
        protected override void DoDefaultAction()
        {
            FileDocumentManager manager = this.GetDocumentManager() as FileDocumentManager;
            Guid           viewGuid     = (this.HasDesigner ? VSConstants.LOGVIEWID_Designer : VSConstants.LOGVIEWID_Code);
            IVsWindowFrame frame;

            manager.Open(false, false, viewGuid, out frame, WindowFrameShowAction.Show);
        }
        /// <summary>
        /// Open a file depending on the SubType property associated with the file item in the project file
        /// </summary>
        protected override void DoDefaultAction()
        {
            FileDocumentManager manager = this.GetDocumentManager() as FileDocumentManager;

            Debug.Assert(manager != null, "Could not get the FileDocumentManager");

            Guid           viewGuid = (IsFormSubType ? VSConstants.LOGVIEWID_Designer : VSConstants.LOGVIEWID_Code);
            IVsWindowFrame frame;

            manager.Open(false, false, viewGuid, out frame, WindowFrameShowAction.Show);
        }
示例#3
0
        /// <summary>
        /// Open a file depending on the SubType property associated with the file item in the project file
        /// </summary>
        protected override void DoDefaultAction()
        {
            FileDocumentManager manager = this.GetDocumentManager() as FileDocumentManager;

            Debug.Assert(manager != null, "Could not get the FileDocumentManager");

            Guid           viewGuid = Guid.Empty;
            IVsWindowFrame frame;

            manager.Open(false, false, viewGuid, out frame, WindowFrameShowAction.Show);
        }
示例#4
0
        /// <summary>
        /// Open a file depending on the SubType property associated with the file item in the project file
        /// </summary>
        protected override void DoDefaultAction()
        {
            if ("WebBrowser".Equals(SubType, StringComparison.OrdinalIgnoreCase))
            {
                CommonPackage.OpenVsWebBrowser(ProjectMgr.Site, Url);
                return;
            }

            FileDocumentManager manager = this.GetDocumentManager() as FileDocumentManager;

            Utilities.CheckNotNull(manager, "Could not get the FileDocumentManager");

            Guid           viewGuid = Guid.Empty;
            IVsWindowFrame frame;

            manager.Open(false, false, viewGuid, out frame, WindowFrameShowAction.Show);
        }
示例#5
0
        protected virtual IVsTextLines GetTextLines()
        {
            CCITracing.TraceCall();
            FileDocumentManager manager = this.GetDocumentManager() as FileDocumentManager;

            Debug.Assert(manager != null, "Could not get the FileDocumentManager");
            Guid           logicalView = Guid.Empty;
            IVsWindowFrame windowFrame = null;
            object         docData;
            VsTextBuffer   lBuffer;
            IVsTextLines   lLines;

            manager.Open(false, false, logicalView, out windowFrame, WindowFrameShowAction.DontShow);
            Debug.Assert(windowFrame != null, "Could not get the IVsWindowFrame");

            windowFrame.GetProperty((int)__VSFPROPID.VSFPROPID_DocData, out docData);

            // Get the VsTextBuffer
            lBuffer = docData as VsTextBuffer;
            if (lBuffer == null)
            {
                IVsTextBufferProvider lBufferProvider = docData as IVsTextBufferProvider;
                if (lBufferProvider != null)
                {
                    NativeMethods.ThrowOnFailure(lBufferProvider.GetTextBuffer(out lLines));
                }
                else
                {
                    throw new Exception("Could get TextLines object.");
                }
            }
            else
            {
                lLines = lBuffer as IVsTextLines;
            }
            return(lLines);
        }