当前位置: 首页>>代码示例>>C#>>正文


C# IMenu.Add方法代码示例

本文整理汇总了C#中IMenu.Add方法的典型用法代码示例。如果您正苦于以下问题:C# IMenu.Add方法的具体用法?C# IMenu.Add怎么用?C# IMenu.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IMenu的用法示例。


在下文中一共展示了IMenu.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnCreateOptionsMenu

        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            MenuInflater.Inflate (Resource.Menu.Main, menu);

            /*var searchMenu = menu.Add ("Search");
            searchMenu.SetVisible (true);
            searchMenu.SetShowAsAction (ShowAsAction.IfRoom);
            searchMenu.SetActionView(new SearchView(this));*/

            var addMenu = menu.Add (1, (int)MenuConstants.MainAdd, 1, "Add");
            addMenu.SetIcon (Resource.Drawable.Add);
            addMenu.SetShowAsAction (ShowAsAction.IfRoom);

            var refreshMenu = menu.Add (1, (int)MenuConstants.MainRefresh, 2, "Refresh");
            refreshMenu.SetIcon (Resource.Drawable.Refresh);
            refreshMenu.SetShowAsAction (ShowAsAction.IfRoom);

            /*var facebookMenu = menu.Add (2, (int)MenuConstants.MainFacebook, 3, "Authorize Facebook");
            facebookMenu.SetIcon (Resource.Drawable.Facebook);
            facebookMenu.SetShowAsAction (ShowAsAction.IfRoom);

            var twitterMenu = menu.Add (2, (int)MenuConstants.MainTwitter, 4, "Authorize Twitter");
            twitterMenu.SetIcon (Resource.Drawable.Twitter);
            twitterMenu.SetShowAsAction (ShowAsAction.IfRoom);*/

            return base.OnCreateOptionsMenu (menu);
        }
开发者ID:hpneo,项目名称:CheckinApp,代码行数:27,代码来源:MainActivity.cs

示例2: OnCreateOptionsMenu

 public override bool OnCreateOptionsMenu(IMenu menu)
 {
     menu.Add("Item 1");
     menu.Add("Item 2");
     menu.Add("Item 3");
     return true;
 }
开发者ID:ARMoir,项目名称:mobile-samples,代码行数:7,代码来源:OptionsMenuScreen.cs

示例3: OnCreateOptionsMenu

        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            base.OnCreateOptionsMenu(menu);

            menu.Add(0, EDIT_ID, 0, Resource.String.menu_edit)
                .SetShortcut('1', 'e')
                .SetIcon(Resource.Drawable.icon_delete);

            //menu.add(0, HOME_ID, 0, R.string.menu_start).setShortcut('4', 'h')
            //    .setIcon(R.drawable.icon_start);

            menu.Add(0, LIST_ID, 0, Resource.String.menu_recent)
                .SetShortcut('3', 'r')
                .SetIcon(Resource.Drawable.icon_recent);

            menu.Add(0, DELETE_ID, 0, Resource.String.menu_delete)
                .SetShortcut('2', 'd')
                .SetIcon(Resource.Drawable.icon_delete);
            //menu.add(0, ABOUT_ID, 0, R.string.menu_about).setShortcut('5', 'a')
            //    .setIcon(android.R.drawable.ic_dialog_info);
            //menu.add(0, EXPORT_ID, 0, R.string.menu_export).setShortcut('7', 'x')
            //    .setIcon(android.R.drawable.ic_dialog_info);
            //menu.add(0, IMPORT_ID, 0, R.string.menu_import).setShortcut('8', 'm')
            //    .setIcon(android.R.drawable.ic_dialog_info);
            //menu.add(0, EMAIL_ID, 0, R.string.menu_email).setShortcut('6', 'm')
            //    .setIcon(android.R.drawable.ic_dialog_info);
            return true;
        }
开发者ID:CBSAdvisor,项目名称:cbs-quantum,代码行数:28,代码来源:WikiNotes.cs

示例4: OnCreateOptionsMenu

        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            var MenuItem1 = menu.Add(0, 1, 1, "Aktualisieren");
            var MenuItem2 = menu.Add(0, 2, 2, "Beenden");

            // Set icon
            return base.OnCreateOptionsMenu(menu);
        }
开发者ID:buehler,项目名称:xamarin-hsr-challenge-project,代码行数:8,代码来源:TimetableActivity.cs

示例5: OnCreateOptionsMenu

        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            menu.Add(Menu.None, 0, Menu.None, "Settings").SetIcon(Android.Resource.Drawable.IcMenuManage);
              menu.Add(Menu.None, 1, Menu.None, "Theme").SetIcon(Android.Resource.Drawable.IcMenuGallery);
              //menu.Add(Menu.None, 2, Menu.None, "Share").SetIcon(Android.Resource.Drawable.IcMenuShare);

              return true;// base.OnCreateOptionsMenu(menu);
        }
开发者ID:mamta-bisht,项目名称:VS2013Roadshow,代码行数:8,代码来源:ChartView.cs

示例6: OnCreateOptionsMenu

 public override bool OnCreateOptionsMenu(IMenu menu)
 {
     var b = base.OnCreateOptionsMenu(menu);
     menu.Add(1, 0, 1, Resource.String.viewcard_Left);
     menu.Add(1, 1, 1, Resource.String.viewcard_Edit);
     menu.Add(1, 2, 1, Resource.String.viewcard_Right);
     return b;
 }
开发者ID:Lissov,项目名称:BonusCards,代码行数:8,代码来源:ViewCardActivity.cs

示例7: OnCreateOptionsMenu

        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            menu.Add (0, 0, 0, "Выбрать журнал");
            menu.Add(0,1,1,"О программе");
            menu.Add(0,2,2,"Выход");

            return true;
        }
开发者ID:baitun,项目名称:BGUEP-Journal,代码行数:8,代码来源:JournalNumber.cs

示例8: OnCreateOptionsMenu

 public override bool OnCreateOptionsMenu(IMenu menu)
 {
     var menuItem1 = menu.Add(0, 1, 1, Resource.String.Copyright);
     var menuItem2 = menu.Add(0, 2, 2, Resource.String.Close);
     menuItem1.SetIcon(Resource.Drawable.exclaim);
     menuItem2.SetIcon(Resource.Drawable.close);
     return base.OnCreateOptionsMenu(menu);
 }
开发者ID:nodoid,项目名称:TimeOfDeath-Android,代码行数:8,代码来源:Activity1.cs

示例9: OnCreateOptionsMenu

 public override bool OnCreateOptionsMenu(IMenu menu)
 {
     var refreshMenuItem = menu.Add(0, 1, 1, Resource.String.Refresh);
     var quitMenuItem = menu.Add(0, 1, 1, Resource.String.Quit);
     refreshMenuItem.SetIcon(Resource.Drawable.refresh);
     quitMenuItem.SetIcon(Resource.Drawable.logout);
     return true;
 }
开发者ID:jphomi,项目名称:Homidom---VS2010,代码行数:8,代码来源:MainActivity.cs

示例10: OnCreateOptionsMenu

 public override bool OnCreateOptionsMenu(IMenu menu)
 {
     menu.Add (0, 0, 0, "切换帐号");
     menu.Add (1, 1, 1, "前一天");
     menu.Add (1, 2, 2, "后一天");
     menu.Add (2, 3, 3, "添加课程");
     return true;
 }
开发者ID:Kagamine,项目名称:CurriculumSchedule,代码行数:8,代码来源:TodayScheduleActivity.cs

示例11: OnCreateOptionsMenu

		public override bool OnCreateOptionsMenu (IMenu menu)
		{
			menu.Add (Menu.None, 0, Menu.None, Resource.String.simpleSaveState);
			menu.Add (Menu.None, 1, Menu.None, Resource.String.nonConfigInstance);
			menu.Add (Menu.None, 2, Menu.None, Resource.String.layoutInCode);

			return base.OnCreateOptionsMenu (menu);
		}
开发者ID:89sos98,项目名称:monodroid-samples,代码行数:8,代码来源:Activity1.cs

示例12: OnCreateOptionsMenu

        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            var res = base.OnCreateOptionsMenu(menu);

            menu.Add(0, MenuItem_AddCard, 0, Resource.String.AddCard);
            menu.Add(0, MenuItem_Exit, 1, Resource.String.Exit);

            return res;
        }
开发者ID:Lissov,项目名称:BonusCards,代码行数:9,代码来源:MainActivity.cs

示例13: OnCreateOptionsMenu

        public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
        {
            // Put overlay items first
            MapView.OverlayManager.OnCreateOptionsMenu(menu, MenuLastId, MapView);

            menu.Add(0, MenuZoominId, Menu.None, "ZoomIn");
            menu.Add(0, MenuZoomoutId, Menu.None, "ZoomOut");

            base.OnCreateOptionsMenu(menu, inflater);
        }
开发者ID:JohnPilczak,项目名称:OsmdroidXamarin,代码行数:10,代码来源:SampleWithMinimapItemizedOverlayWithFocus.cs

示例14: OnCreateOptionsMenu

 public override bool OnCreateOptionsMenu(IMenu menu)
 {
     var configItem = menu.Add(0, 1, 1, "Config".ToJ());
     configItem.SetIcon(Resource.Drawable.ic_menu_preferences);
     var aboutItem = menu.Add(0, 1, 1, "About".ToJ());
     aboutItem.SetIcon(Resource.Drawable.ic_menu_info_details); // IcMenuInfoDetails);
     var exitItem = menu.Add(0, 1, 1, "Exit".ToJ());
     exitItem.SetIcon(Resource.Drawable.ic_menu_close_clear_cancel);
     return true;
 }
开发者ID:mgroves,项目名称:MonodroidStockPortfolio,代码行数:10,代码来源:MainActivity.cs

示例15: OnCreateOptionsMenu

        /// <summary>
        /// http://mgroves.com/monodroid-creating-an-options-menu/ 
        /// </summary>
        public override bool OnCreateOptionsMenu(IMenu menu)
        {
            var item = menu.Add(Menu.None, 1, 1, new Java.Lang.String("Schedule"));
            //item.SetIcon(Resource.Drawable.calendar);

            item = menu.Add(Menu.None, 2, 2, new Java.Lang.String("Speakers"));  // HACK: todo - add 'using' statement around Java.Lang.Strings for GC (as per novell hint)
            //item.SetIcon(Resource.Drawable.microphone);

            item = menu.Add(Menu.None, 3, 3, new Java.Lang.String("Sessions"));
            //item.SetIcon(Resource.Drawable.bullhorn);

            item = menu.Add(Menu.None, 4, 4, new Java.Lang.String("Map"));
            //item.SetIcon(Resource.Drawable.map);

            item = menu.Add(Menu.None, 5, 5, new Java.Lang.String("Favorites"));
            //item.SetIcon(Resource.Drawable.star);

            item = menu.Add(Menu.None, 6, 6, new Java.Lang.String("News"));
            //item.SetIcon(Resource.Drawable.star);

            item = menu.Add(Menu.None, 7, 7, new Java.Lang.String("Twitter"));
            //item.SetIcon(Resource.Drawable.star);

            item = menu.Add(Menu.None, 8, 8, new Java.Lang.String("Exhibitors"));
            //item.SetIcon(Resource.Drawable.star);

            item = menu.Add(Menu.None, 9, 9, new Java.Lang.String("About Xamarin"));
            //item.SetIcon(Resource.Drawable.star);

            return true;
        }
开发者ID:kssagra,项目名称:SagraEmi,代码行数:34,代码来源:BaseScreen.cs


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