Exemplo n.º 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);
        }
Exemplo n.º 2
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;
        }
Exemplo n.º 3
0
 public XinqEditor(XinqPackage package, XinqEditorPane editorPane)
     : this()
 {
     _package = package;
     _editorPane = editorPane;
 }
Exemplo n.º 4
0
 public XinqEditor(XinqPackage package, XinqEditorPane editorPane) : this()
 {
     _package    = package;
     _editorPane = editorPane;
 }