• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# IContextMenu类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IContextMenu的典型用法代码示例。如果您正苦于以下问题:C# IContextMenu类的具体用法?C# IContextMenu怎么用?C# IContextMenu使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



IContextMenu类属于命名空间,在下文中一共展示了IContextMenu类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: ContextMenuStrip_Opening

 private void ContextMenuStrip_Opening(object sender, CancelEventArgs e)
 {
     ContextMenuStrip strip = (ContextMenuStrip) sender;
     if ((strip.Items.Count <= 1) && (strip.Items[0].Text == string.Empty))
     {
         if ((this.ContextMenu == null) && (this.FileNames != null))
         {
             this.ContextMenu = GetContextMenu(this.Owner, this.ParentName, this.FileNames);
         }
         if (this.ContextMenu == null)
         {
             e.Cancel = true;
         }
         else
         {
             this.ContextMenu3 = this.ContextMenu as IContextMenu3;
             if (this.ContextMenu3 == null)
             {
                 this.ContextMenu2 = this.ContextMenu as IContextMenu2;
             }
             this.Menu = Windows.CreatePopupMenu();
             this.ContextMenu.QueryContextMenu(this.Menu, 0, 1, 0x7fff, this.Options | (((Control.ModifierKeys & Keys.Shift) > Keys.None) ? CMF.CMF_EXTENDEDVERBS : CMF.CMF_NORMAL));
             if (this.ContextMenu3 != null)
             {
                 this.ContextMenu3.HandleMenuMsg2(0x117, this.Menu, IntPtr.Zero, IntPtr.Zero);
             }
             else if (this.ContextMenu2 != null)
             {
                 this.ContextMenu2.HandleMenuMsg(0x117, this.Menu, IntPtr.Zero);
             }
             this.InitializeToolStrip(strip, this.Menu);
         }
     }
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:34,代码来源:ShellContextMenuHelper.cs


示例2: OnCreateContextMenu

 public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo info)
 {
     base.OnCreateOptionsMenu (menu);
     menu.SetHeaderTitle("Выберите действие");
     menu.Add(0, MENU_ITEM_EDIT, 0, "Редактировать");
     menu.Add(0, MENU_ITEM_DELETE, 0, "Удалить");
 }
开发者ID:pafik13,项目名称:PresenterPlanner,代码行数:7,代码来源:DoctorsList.cs


示例3: OnCreateContextMenu

        public override void OnCreateContextMenu(IContextMenu menu, View v,
			IContextMenuContextMenuInfo  menuInfo)
        {
            AdapterView.AdapterContextMenuInfo acmi = (AdapterView.AdapterContextMenuInfo) menuInfo;
            ClickView cv = (ClickView) acmi.TargetView;
            cv.OnCreateMenu(menu, menuInfo);
        }
开发者ID:pythe,项目名称:wristpass,代码行数:7,代码来源:SearchResults.cs


示例4: GetCommandStringW

        /// <summary>
        /// Retrieves the command string for a specific item from an iContextMenu (Unicode)
        /// </summary>
        /// <param name="iContextMenu">the IContextMenu to receive the string from</param>
        /// <param name="idcmd">the id of the specific item</param>
        /// <param name="executeString">indicating whether it should return an execute string or not</param>
        /// <returns>if executeString is true it will return the executeString for the item, 
        /// otherwise it will return the help info string</returns>
        public static string GetCommandStringW(IContextMenu iContextMenu, uint idcmd, bool executeString)
        {
            string info = string.Empty;
            byte[] bytes = new byte[256];

            iContextMenu.GetCommandString(
                                            idcmd,
                                            (executeString ? ShellAPI.GCS.VERBW : ShellAPI.GCS.HELPTEXTW),
                                            0,
                                            bytes,
                                            ShellAPI.MAX_PATH);

            int index = 0;
            while (index < bytes.Length - 1 && (bytes[index] != 0 || bytes[index + 1] != 0))
            {
                index += 2;
            }

            if (index < bytes.Length - 1)
            {
                info = Encoding.Unicode.GetString(bytes, 0, index + 1);
            }

            return info;
        }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:33,代码来源:ContextMenuHelper.cs


示例5: GetCommandStringW

        /// <summary>
        /// Retrieves the command string for a specific item from an iContextMenu (Unicode)
        /// </summary>
        /// <param name="iContextMenu">the IContextMenu to receive the string from</param>
        /// <param name="idcmd">the id of the specific item</param>
        /// <param name="executeString">indicating whether it should return an execute string or not</param>
        /// <returns>if executeString is true it will return the executeString for the item, 
        /// otherwise it will return the help info string</returns>
        public static string GetCommandStringW(IContextMenu iContextMenu, uint idcmd, bool executeString)
        {
            string info = string.Empty;
            byte[] bytes = new byte[256];

            iContextMenu.GetCommandString(
                                            idcmd,
                                            (executeString ? GCS.VerbW : GCS.HelpTextW),
                                            0,
                                            bytes,
                                            ShellApi.MaxPath);

            int index = 0;
            while (index < bytes.Length - 1 && (bytes[index] != 0 || bytes[index + 1] != 0))
            {
                index += 2;
            }

            if (index < bytes.Length - 1)
            {
                info = Encoding.Unicode.GetString(bytes, 0, index + 1);
            }

            return info;
        }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:33,代码来源:ContextMenuHelper.cs


示例6: GetCommandStringA

        /// <summary>
        /// Retrieves the command string for a specific item from an iContextMenu (Ansi)
        /// </summary>
        /// <param name="iContextMenu">the IContextMenu to receive the string from</param>
        /// <param name="idcmd">the id of the specific item</param>
        /// <param name="executeString">indicating whether it should return an execute string or not</param>
        /// <returns>if executeString is true it will return the executeString for the item, 
        /// otherwise it will return the help info string</returns>
        public static string GetCommandStringA(IContextMenu iContextMenu, uint idcmd, bool executeString)
        {
            string info = string.Empty;
            byte[] bytes = new byte[256];

            iContextMenu.GetCommandString(
                                          idcmd,
                                          (executeString ? ShellAPI.GCS.VERBA : ShellAPI.GCS.HELPTEXTA),
                                          0,
                                          bytes,
                                          ShellAPI.MAX_PATH);

            int index = 0;
            while (index < bytes.Length && bytes[index] != 0)
            {
                index++;
            }

            if (index < bytes.Length)
            {
                info = Encoding.Default.GetString(bytes, 0, index);
            }

            return info;
        }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:33,代码来源:ContextMenuHelper.cs


示例7: GetCommandStringA

        /// <summary>
        /// Retrieves the command string for a specific item from an iContextMenu (Ansi)
        /// </summary>
        /// <param name="iContextMenu">the IContextMenu to receive the string from</param>
        /// <param name="idcmd">the id of the specific item</param>
        /// <param name="executeString">indicating whether it should return an execute string or not</param>
        /// <returns>if executeString is true it will return the executeString for the item, 
        /// otherwise it will return the help info string</returns>
        public static string GetCommandStringA(IContextMenu iContextMenu, uint idcmd, bool executeString)
        {
            string info = string.Empty;
            byte[] bytes = new byte[256];

            iContextMenu.GetCommandString(
                                          idcmd,
                                          (executeString ? GCS.VerbA : GCS.HelpTextA),
                                          0,
                                          bytes,
                                          ShellApi.MaxPath);

            int index = 0;
            while (index < bytes.Length && bytes[index] != 0)
            {
                index++;
            }

            if (index < bytes.Length)
            {
                info = Encoding.Default.GetString(bytes, 0, index);
            }

            return info;
        }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:33,代码来源:ContextMenuHelper.cs


示例8: OnCreateContextMenu

            public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo)
            {
                base.OnCreateContextMenu (menu, v, menuInfo);

                menu.Add(Menu.None, Resource.Id.a_item, Menu.None, "Menu A");
                menu.Add(Menu.None, Resource.Id.b_item, Menu.None, "Menu B");
            }
开发者ID:vkheleli,项目名称:monodroid-samples-master,代码行数:7,代码来源:FragmentContextMenuSupport.cs


示例9: OnCreateContextMenu

		public override void OnCreateContextMenu (IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo)
		{
			menu.Add ("One");
			menu.Add ("Two");
			menu.Add ("Three");
			menu.Add ("Four");
		}
开发者ID:adbk,项目名称:spikes,代码行数:7,代码来源:ContextMenus.cs


示例10: OnCreateContextMenu

        public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo)
        {
            base.OnCreateContextMenu (menu, v, menuInfo);

            menu.Add (0, 0, 0, "Hide App");
            menu.Add (0, 1, 1, "Uninstall App");
        }
开发者ID:Redth,项目名称:FlamedTVLauncher,代码行数:7,代码来源:MainActivity.cs


示例11: BeforePopupEventArgs

 public BeforePopupEventArgs(IntPtr ptrPopupMenu, IContextMenu iContextMenu, uint defaultCommandID, string defaultCommand)
 {
     this.ptrPopupMenu = ptrPopupMenu;
     this.iContextMenu = iContextMenu;
     ContinuePopup = true;
     DefaultCommandID = defaultCommandID;
     DefaultCommand = defaultCommand;
 }
开发者ID:Choi-Insu,项目名称:arrengers,代码行数:8,代码来源:ContextMenuWrapper.cs


示例12: OnCreateContextMenu

		public override void OnCreateContextMenu (IContextMenu menu, View view, IContextMenuContextMenuInfo menuInfo)
		{
			var info = (AdapterView.AdapterContextMenuInfo)menuInfo;
			var note = (Note)ListAdapter.GetItem (info.Position);

			// Add a menu item to delete the note
			menu.Add (0, MENU_ITEM_DELETE, 0, Resource.String.menu_delete);
		}
开发者ID:CHANDAN145,项目名称:monodroid-samples,代码行数:8,代码来源:NotesListActivity.cs


示例13: OnCreateContextMenu

 void View.IOnCreateContextMenuListener.OnCreateContextMenu(IContextMenu menu, View v,
                                                            IContextMenuContextMenuInfo menuInfo)
 {
     if (OnCreateContextMenu != null)
     {
         OnCreateContextMenu(menu, v, menuInfo);
     }
 }
开发者ID:jlarsson,项目名称:MonoDroid.Simplified,代码行数:8,代码来源:OnCreateContextMenuListener.cs


示例14: ShellContextMenuHelper

 private ShellContextMenuHelper(IWin32Window owner, IContextMenu contextMenu, ContextMenuOptions options, EventHandler<ExecuteVerbEventArgs> onExecuteVerb)
 {
     this.ItemContainer = new Container();
     this.OnExecuteVerb = null;
     this.Owner = owner;
     this.ContextMenu = contextMenu;
     this.Options = ((((options & ContextMenuOptions.Explore) > 0) ? (CMF.CMF_NORMAL | CMF.CMF_EXPLORE) : CMF.CMF_NORMAL) | (((options & ContextMenuOptions.CanRename) > 0) ? CMF.CMF_CANRENAME : CMF.CMF_NORMAL)) | (((options & ContextMenuOptions.VerbsOnly) > 0) ? (CMF.CMF_NORMAL | CMF.CMF_VERBSONLY) : CMF.CMF_NORMAL);
     this.OnExecuteVerb = onExecuteVerb;
 }
开发者ID:shankithegreat,项目名称:commanderdotnet,代码行数:9,代码来源:ShellContextMenuHelper.cs


示例15: OnCreateContextMenu

		public override void OnCreateContextMenu (IContextMenu menu, View view, IContextMenuContextMenuInfo menuInfo)
		{
			base.OnCreateContextMenu (menu, view, menuInfo);
			AdapterView.AdapterContextMenuInfo info =(AdapterView.AdapterContextMenuInfo) menuInfo;
			Tunnel.Client client = listAdapter[info.Position];
			menu.SetHeaderTitle("Client " + client.ID+" at " + client.Address);
			menu.Add(Menu.None,0,0,"Throw off");

		}
开发者ID:seipekm,项目名称:MonoBrick-Communication-Software,代码行数:9,代码来源:ClientsActivity.cs


示例16: ProjectExplorerItem

        /// <summary>
        ///     Initializes a new instance of the <see cref="ProjectExplorerItem" /> class.
        /// </summary>
        /// <param name="itemValue">The itemValue rappresented by this item.</param>
        /// <param name="contextMenu">The context menu.</param>
        public ProjectExplorerItem(object itemValue, IContextMenu contextMenu)
        {
            Check.IfIsNull(itemValue).Throw<ArgumentNullException>(() => itemValue);

            this.itemValue = itemValue;
            var ctxMenuItems = contextMenu == null ? new List<IMenuItem>() : contextMenu.Items;
            contextMenuItems = new ObservableCollection<IMenuItem>(ctxMenuItems);
            children = new ObservableCollection<IProjectExplorerItem>();
        }
开发者ID:SimoneLocatelli,项目名称:AncientTimesEditor,代码行数:14,代码来源:ProjectExplorerItem.cs


示例17: OnCreateContextMenu

 public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo)
 {
     if (v.Id == Resource.Id.accountList)
     {
         menu.SetHeaderTitle(Strings.SelectOperationLabel);
         menu.Add(Strings.EditLabel);
         menu.Add(Strings.DeleteLabel);
     }
 }
开发者ID:M-Zuber,项目名称:MoneyManager,代码行数:9,代码来源:CategoryListActivity.cs


示例18: OnCreateContextMenu

        public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo)
        {
            base.OnCreateContextMenu(menu, v, menuInfo);

            if (v == _text)
            {
                MenuInflater.Inflate(Resource.Menu.context_menu, menu);
                menu.SetHeaderTitle(new Java.Lang.String("Favorite browser?"));
            }
        }
开发者ID:jorik041,项目名称:Sample-Projects,代码行数:10,代码来源:MenuDemoActivity.cs


示例19: OnCreateContextMenu

        public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo)
        {
            base.OnCreateContextMenu(menu, v, menuInfo);

            m_EditTaskPosition = ((AdapterView.AdapterContextMenuInfo)menuInfo).Position;

            menu.SetHeaderTitle(m_AllTasks[m_EditTaskPosition].Task);

            MenuInflater.Inflate(Resource.Menu.ContextMenuHistoryTask, menu);
        }
开发者ID:CodigoMonki,项目名称:TasksSimplified,代码行数:10,代码来源:HistoryActivity.cs


示例20: OnCreateContextMenu

        public override void OnCreateContextMenu(IContextMenu menu, View v, IContextMenuContextMenuInfo menuInfo)
        {
            base.OnCreateContextMenu(menu, v, menuInfo);

            var info = (AdapterView.AdapterContextMenuInfo)menuInfo;
            var id = (int)info.Id;

            menu.SetHeaderTitle("Options".ToJ());
            menu.Add(0, id, 1, "Rename".ToJ());
            menu.Add(0, id, 2, "Delete".ToJ());
        }
开发者ID:mgroves,项目名称:MonodroidStockPortfolio,代码行数:11,代码来源:MainActivity.cs



注:本文中的IContextMenu类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# IContextRegistry类代码示例发布时间:2022-05-24
下一篇:
C# IContextExpression类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap