Exemplo n.º 1
0
        /// <include file='doc\VsWindowPane.uex' path='docs/doc[@for="VsWindowPane.IVsToolboxUser.ItemPicked"]/*' />
        /// <devdoc>
        ///     This happens when a user double-clicks a toolbox item.  We add the
        ///     item to the center of the form.
        /// </devdoc>
        void IVsToolboxUser.ItemPicked(NativeMethods.IOleDataObject pDO)
        {
            if (toolboxService == null)
            {
                toolboxService = (IToolboxService)GetService((typeof(IToolboxService)));
            }

            if (toolboxService != null)
            {
                ToolboxItem item = toolboxService.DeserializeToolboxItem(pDO, DesignerHost);

                if (item != null)
                {
                    if (OnToolPicked(item))
                    {
                        toolboxService.SelectedToolboxItemUsed();
                    }
                }
            }

            if (toolboxUser == null)
            {
                toolboxUser = (IVsToolboxUser)GetService(typeof(IVsToolboxUser));
            }

            if (toolboxUser != null)
            {
                toolboxUser.ItemPicked(pDO);
            }
        }
Exemplo n.º 2
0
        /// <include file='doc\VsWindowPane.uex' path='docs/doc[@for="VsWindowPane.IVsToolboxUser.IsSupported"]/*' />
        /// <devdoc>
        /// </devdoc>
        int IVsToolboxUser.IsSupported(NativeMethods.IOleDataObject pDO)
        {
            int supported = NativeMethods.S_FALSE;

            if (toolboxService == null)
            {
                toolboxService = (IToolboxService)GetService(typeof(IToolboxService));
            }

            if (toolboxService != null && toolboxService.IsSupported(pDO, DesignerHost))
            {
                supported = NativeMethods.S_OK;
            }

            if (toolboxUser == null)
            {
                toolboxUser = (IVsToolboxUser)GetService(typeof(IVsToolboxUser));
            }

            if (toolboxUser != null)
            {
                if (toolboxUser.IsSupported(pDO) == NativeMethods.S_OK)
                {
                    supported = NativeMethods.S_OK;
                }
            }

            return(supported);
        }
Exemplo n.º 3
0
        int NativeMethods.IDocHostUIHandler.FilterDataObject(NativeMethods.IOleDataObject pDO, out NativeMethods.IOleDataObject ppDORet)
        {
            Debug.WriteLineIf(StyleBuilder.StyleBuilderSwitch.TraceVerbose, "CTridentSite: IDocHostUIHandler::FilterDataObject");

            ppDORet = null;
            return(NativeMethods.S_OK);
        }
Exemplo n.º 4
0
 int NativeMethods.IDocHostUIHandler.FilterDataObject(NativeMethods.IOleDataObject pDO, out NativeMethods.IOleDataObject ppDORet)
 {
     ppDORet = null;
     return(NativeMethods.E_NOTIMPL);
 }
Exemplo n.º 5
0
 public virtual int FilterDataObject(NativeMethods.IOleDataObject pDO, out NativeMethods.IOleDataObject ppDORet)
 {
     ppDORet = null;
     return(NativeMethods.S_OK);
 }
Exemplo n.º 6
0
 public WrappedDataObject(NativeMethods.IOleDataObject pDO) : base(pDO)
 {
     nativePtr = Marshal.GetIUnknownForObject(pDO);
     Marshal.Release(nativePtr);
 }