Beispiel #1
0
        public int CreateEditorInstance(uint grfCreateDoc, string pszMkDocument, string pszPhysicalView, IVsHierarchy pvHier, uint itemid, IntPtr punkDocDataExisting, out IntPtr ppunkDocView, out IntPtr ppunkDocData, out string pbstrEditorCaption, out Guid pguidCmdUI, out int pgrfCDW)
        {
            // --- Initialize to null
            ppunkDocView       = IntPtr.Zero;
            ppunkDocData       = IntPtr.Zero;
            pguidCmdUI         = GetType().GUID;
            pgrfCDW            = 0;
            pbstrEditorCaption = null;
            // --- Validate inputs
            if ((grfCreateDoc & (VSConstants.CEF_OPENFILE | VSConstants.CEF_SILENT)) == 0)
            {
                return(VSConstants.E_INVALIDARG);
            }
            if (punkDocDataExisting != IntPtr.Zero)
            {
                return(VSConstants.VS_E_INCOMPATIBLEDOCDATA);
            }
            // --- Create the Document (editor)
            SQLEditor newEditor = new SQLEditor(_ServiceProvider);

            ppunkDocView       = Marshal.GetIUnknownForObject(newEditor);
            ppunkDocData       = Marshal.GetIUnknownForObject(newEditor);
            pbstrEditorCaption = "";
            return(VSConstants.S_OK);
        }
 public int CreateEditorInstance(uint grfCreateDoc, string pszMkDocument, string pszPhysicalView, IVsHierarchy pvHier, uint itemid, IntPtr punkDocDataExisting, out IntPtr ppunkDocView, out IntPtr ppunkDocData, out string pbstrEditorCaption, out Guid pguidCmdUI, out int pgrfCDW)
 {
     // --- Initialize to null
     ppunkDocView = IntPtr.Zero;
     ppunkDocData = IntPtr.Zero;
     pguidCmdUI = GetType().GUID;
     pgrfCDW = 0;
     pbstrEditorCaption = null;
     // --- Validate inputs
     if ((grfCreateDoc & (VSConstants.CEF_OPENFILE | VSConstants.CEF_SILENT)) == 0)
     {
         return VSConstants.E_INVALIDARG;
     }
     if (punkDocDataExisting != IntPtr.Zero)
     {
         return VSConstants.VS_E_INCOMPATIBLEDOCDATA;
     }
     // --- Create the Document (editor)
     SQLEditor newEditor = new SQLEditor(_ServiceProvider);
     ppunkDocView = Marshal.GetIUnknownForObject(newEditor);
     ppunkDocData = Marshal.GetIUnknownForObject(newEditor);
     pbstrEditorCaption = "";
     return VSConstants.S_OK;
 }
Beispiel #3
0
 public CodeWindow(UserControl editor)
 {
     _editor = editor as SQLEditor;
     InitializeComponent();
 }
Beispiel #4
0
 public CodeWindow(UserControl editor)
 {
     _editor = editor as SQLEditor;
     InitializeComponent();
 }