Example #1
0
 /// <include file='doc\EditorView.uex' path='docs/doc[@for="OleEditorView.UseComponentUIManager"]/*' />
 public virtual int UseComponentUIManager(uint dwCompRole, out uint pgrfCompFlags, IOleComponentUIManager pCompUIMgr, IOleInPlaceComponentSite pIPCompSite)
 {
     pgrfCompFlags    = 0;
     this.pCompUIMgr  = pCompUIMgr;
     this.pIPCompSite = pIPCompSite;
     return(NativeMethods.S_OK);
 }
Example #2
0
 public virtual void UseComponentUIManager(uint dwCompRole, out uint pgrfCompFlags,
                                           IOleComponentUIManager pCompUIMgr, IOleInPlaceComponentSite pIPCompSite)
 {
     pgrfCompFlags    = 0;
     this.pCompUIMgr  = pCompUIMgr;
     this.pIPCompSite = pIPCompSite;
 }
Example #3
0
        /// <include file='doc\OleMenuCommandService.uex' path='docs/doc[@for="OleMenuCommandService.ShowContextMenu"]/*' />
        /// <devdoc>
        ///     Shows the context menu with the given command ID at the given
        ///     location.
        /// </devdoc>
        public override void ShowContextMenu(CommandID menuID, int x, int y)
        {
            IOleComponentUIManager cui = GetService(typeof(NativeMethods.OleComponentUIManager)) as IOleComponentUIManager;

            Debug.Assert(cui != null, "no component UI manager, so we can't display a context menu");
            if (cui != null)
            {
                POINTS[] pt = new POINTS[] { new POINTS() };
                pt[0].x = (short)x;
                pt[0].y = (short)y;

                Guid tmpGuid = menuID.Guid;
                NativeMethods.ThrowOnFailure(cui.ShowContextMenu(0, ref tmpGuid, menuID.ID, pt, this));
            }
        }
Example #4
0
        /// <include file='doc\MenuCommandService.uex' path='docs/doc[@for="MenuCommandService.ShowContextMenu"]/*' />
        /// <devdoc>
        ///     Shows the context menu with the given command ID at the given
        ///     location.
        /// </devdoc>
        public void ShowContextMenu(CommandID menuID, int x, int y)
        {
            if (serviceProvider == null)
            {
                return;
            }
            IOleComponentUIManager cui = (IOleComponentUIManager)serviceProvider.GetService(typeof(OleComponentUIManager));

            Debug.Assert(cui != null, "no component UI manager, so we can't display a context menu");
            if (cui != null)
            {
                tagPOINTS pt = new tagPOINTS();
                pt.x = (short)x;
                pt.y = (short)y;

                Guid tmpGuid = menuID.Guid;
                cui.ShowContextMenu(0, ref tmpGuid, menuID.ID, pt, this);
            }
        }
Example #5
0
 public virtual int UseComponentUIManager(uint dwCompRole, out uint pgrfCompFlags, 
   IOleComponentUIManager pCompUIMgr, IOleInPlaceComponentSite pIPCompSite){
   pgrfCompFlags = 0;    
   this.pCompUIMgr = pCompUIMgr;
   this.pIPCompSite = pIPCompSite;
   return 0;
 }