コード例 #1
0
        public override int CreateEditorInstance(uint createDocFlags, string moniker, string physicalView, IVsHierarchy pHier, uint itemid, IntPtr existingDocData, out IntPtr docView, out IntPtr docData, out string editorCaption, out Guid cmdUI, out int cancelled)
        {
            docView       = IntPtr.Zero;
            docData       = IntPtr.Zero;
            editorCaption = null;
            cmdUI         = GuidList.XinqEditorFactoryGuid;
            cancelled     = 1;

            if ((createDocFlags & (VSConstants.CEF_OPENFILE | VSConstants.CEF_SILENT)) == 0)
            {
                return(VSConstants.E_INVALIDARG);
            }

            // Prompt user to close the currently open editor
            if (existingDocData != IntPtr.Zero)
            {
                return(VSConstants.VS_E_INCOMPATIBLEDOCDATA);
            }

            var editor = new XinqEditorPane(_package);

            docView       = Marshal.GetIUnknownForObject(editor);
            docData       = Marshal.GetIUnknownForObject(editor);
            editorCaption = _package.GetResourceString(113);
            cancelled     = 0;

            return(VSConstants.S_OK);
        }
コード例 #2
0
ファイル: XinqEditorFactory.cs プロジェクト: ans-ashkan/Xinq
        public override int CreateEditorInstance(uint createDocFlags, string moniker, string physicalView, IVsHierarchy pHier, uint itemid, IntPtr existingDocData, out IntPtr docView, out IntPtr docData, out string editorCaption, out Guid cmdUI, out int cancelled)
        {
            docView = IntPtr.Zero;
            docData = IntPtr.Zero;
            editorCaption = null;
            cmdUI = GuidList.XinqEditorFactoryGuid;
            cancelled = 1;

            if ((createDocFlags & (VSConstants.CEF_OPENFILE | VSConstants.CEF_SILENT)) == 0)
                return VSConstants.E_INVALIDARG;

            // Prompt user to close the currently open editor
            if (existingDocData != IntPtr.Zero)
                return VSConstants.VS_E_INCOMPATIBLEDOCDATA;

            var editor = new XinqEditorPane(_package);
            docView = Marshal.GetIUnknownForObject(editor);
            docData = Marshal.GetIUnknownForObject(editor);
            editorCaption = _package.GetResourceString(113);
            cancelled = 0;

            return VSConstants.S_OK;
        }
コード例 #3
0
ファイル: XinqEditor.cs プロジェクト: ans-ashkan/Xinq
 public XinqEditor(XinqPackage package, XinqEditorPane editorPane)
     : this()
 {
     _package = package;
     _editorPane = editorPane;
 }
コード例 #4
0
ファイル: XinqEditor.cs プロジェクト: faridprogrammer/Xinq
 public XinqEditor(XinqPackage package, XinqEditorPane editorPane) : this()
 {
     _package    = package;
     _editorPane = editorPane;
 }