// Methods
 internal GetMenuitemsEventArgs(ShellMenu menu, QueryContextMenuFlags flags, int startIndex, int maxMenuItemsAvailable)
 {
     this.xcbf78b15dd820156 = menu;
     this.xebf45bdcaa1fd1e1 = flags;
     this.xd4f974c06ffa392b = startIndex;
     this.xf9a8b85e42520bdc = maxMenuItemsAvailable;
 }
Exemple #2
0
 private int xe6b590f4a33ffa7d(IntPtr x4b1e528311f74227, int x77673e48b8a47af3, int xe8d21c371f0934ef, int x25f7ac57a1bdea71, QueryContextMenuFlags x65e70cabb0b3496f)
 {
     try
     {
         xcbf78b15dd820156 = new ShellMenu(x4b1e528311f74227, xe8d21c371f0934ef, x77673e48b8a47af3);
         GetMenuitemsEventArgs e = new GetMenuitemsEventArgs(xcbf78b15dd820156, x65e70cabb0b3496f, x77673e48b8a47af3, (x25f7ac57a1bdea71 - xe8d21c371f0934ef) + 1);
         OnGetMenuItems(e);
         if ((xcbf78b15dd820156.x1dbcf1591cc2cceb.x6f7e5ea46c16afdf + e.xa60d4d9c2d90066f) > x25f7ac57a1bdea71)
         {
             throw new InvalidOperationException("Number of menu items is greater than allowed by host(Windows Explorer)");
         }
         return((xcbf78b15dd820156.x1dbcf1591cc2cceb.x6f7e5ea46c16afdf - xcbf78b15dd820156.x1dbcf1591cc2cceb.xf79f6f55056dea4c) + e.xa60d4d9c2d90066f);
     }
     catch
     {
         return(x443cc432acaadb1d.x15f59d42384ec1d4);
     }
 }
Exemple #3
0
 int IContextMenu3.x1bdb3deb8261a3c4(IntPtr x4b1e528311f74227, int x77673e48b8a47af3, int xe8d21c371f0934ef, int x25f7ac57a1bdea71, QueryContextMenuFlags x65e70cabb0b3496f)
 {
     return(xe6b590f4a33ffa7d(x4b1e528311f74227, x77673e48b8a47af3, xe8d21c371f0934ef, x25f7ac57a1bdea71, x65e70cabb0b3496f));
 }
 int IContextMenu.QueryContextMenu(IntPtr hMenu, uint indexMenu, uint idCmdFirst, uint idCmdLast, QueryContextMenuFlags uFlags)
 {
     return(_impl.QueryContextMenu(hMenu, indexMenu, idCmdFirst, idCmdLast, uFlags));
 }
        /// <inheritdoc/>
        public int QueryContextMenu(IntPtr hMenu, uint indexMenu, uint idCmdFirst, uint idCmdLast, QueryContextMenuFlags uFlags)
        {
            if (uFlags.HasFlag(QueryContextMenuFlags.CMF_DEFAULTONLY))
            {
                return(HRESULT.MakeHResult((uint)HRESULT.S_OK, 0, 0));
            }

            _menutStartId = idCmdFirst;
            foreach (var item in Options.ContextMenuItems)
            {
                item.AddToMenu(hMenu, indexMenu++, ref idCmdFirst, _contextMenuActions);
            }

            return(HRESULT.MakeHResult((uint)HRESULT.S_OK, 0, idCmdFirst + 1)); // #id of last command + 1
        }
 int IContextMenu.QueryContextMenu(IntPtr hMenu, int indexMenu, int idCmdFirst, int idCmdLast, QueryContextMenuFlags uFlags)
 {
     int firstID = idCmdFirst;
     AddItems(m_CtxMenu.MenuItems, hMenu, indexMenu, ref idCmdFirst);
     return (idCmdFirst - firstID);
 }