本文整理汇总了C#中IMenu.GetItem方法的典型用法代码示例。如果您正苦于以下问题:C# IMenu.GetItem方法的具体用法?C# IMenu.GetItem怎么用?C# IMenu.GetItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IMenu
的用法示例。
在下文中一共展示了IMenu.GetItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
menu.GetItem (4).SetVisible (true); // add
switch (ViewModel.State) {
case 0: // idle
menu.GetItem (0).SetVisible (false); // go
menu.GetItem (1).SetVisible (false); // pause
menu.GetItem (2).SetVisible (false); // resume
menu.GetItem (3).SetVisible (false); // finish
break;
case 1: // go
menu.GetItem (0).SetVisible (false); // go
menu.GetItem (1).SetVisible (true); // pause
menu.GetItem (2).SetVisible (false); // resume
menu.GetItem (3).SetVisible (true); // finish
break;
case 2: // pause
menu.GetItem (0).SetVisible (false); // go
menu.GetItem (1).SetVisible (false); // pause
menu.GetItem (2).SetVisible (true); // resume
menu.GetItem (3).SetVisible (true); // finish
break;
default:
throw new NotImplementedException ();
}
return true;
}
示例2: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
var drawerOpen = this._drawer.IsDrawerOpen(this._drawerList);
//when open down't show anything
for (int i = 0; i < menu.Size(); i++)
menu.GetItem(i).SetVisible(!drawerOpen);
return base.OnPrepareOptionsMenu(menu);
}
示例3: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
var drawerOpen = drawerLayout.IsDrawerOpen(drawerListView);
//When we open the drawer we usually do not want to show any menu options
for (int i = 0; i < menu.Size(); i++)
menu.GetItem(i).SetVisible(!drawerOpen);
return base.OnPrepareOptionsMenu(menu);
}
示例4: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
if (ActionBar == null)
return base.OnPrepareOptionsMenu(menu);
for (int i = 0; i < menu.Size(); i++)
{
var menuItem = menu.GetItem(i);
menuItem.SetVisible(!ActionBar.MenuItemsToHide.Contains(menuItem.ItemId));
}
return base.OnPrepareOptionsMenu(menu);
}
示例5: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
if (LegacyBar == null)
return base.OnPrepareOptionsMenu(menu);
menu.Clear();
MenuInflater.Inflate(MenuId, menu);
for (var i = 0; i < menu.Size(); i++)
{
var menuItem = menu.GetItem(i);
menuItem.SetVisible(!LegacyBar.MenuItemsToHide.Contains(menuItem.ItemId));
}
return base.OnPrepareOptionsMenu(menu);
}
示例6: ClearInternal
internal static void ClearInternal(IMenu menu)
{
if (menu == null)
return;
int size = menu.Size();
for (int i = 0; i < size; i++)
MenuItemTemplate.ClearInternal(menu.GetItem(i));
menu.Clear();
menu.ClearBindings(true, true);
}
示例7: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
bool connected = (SteamService.GetClient() != null && SteamService.GetClient().LoggedIn);
menu.GetItem(0).SetEnabled(connected);
menu.GetItem(1).SetEnabled(connected);
return base.OnPrepareOptionsMenu(menu);
}
示例8: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu (IMenu menu)
{
menu.Add ("Home");
menu.GetItem (0).SetOnMenuItemClickListener (new GoHomeClickListener (this));
return true;
}
示例9: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
menu.GetItem (1).SetTitle (new Java.Lang.String (mToggleLabels [mLabelIndex]));
return true;
}
示例10: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
if (this.menu == null) {
base.OnCreateOptionsMenu (menu);
this.menu = menu;
MenuInflater inflater = this.MenuInflater;
inflater.Inflate (Resource.Menu.menu_search_result, menu);
menu.GetItem (0).SetVisible (false);
}
return true;
}
示例11: OnCreateOptionsMenu
public override void OnCreateOptionsMenu(IMenu menu, MenuInflater inflater)
{
inflater.Inflate(Resource.Menu.CameraMenu, menu);
menu.GetItem (0).SetShowAsAction (ShowAsAction.Always);
}
示例12: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu (IMenu menu)
{
var drawerOpen = this.drawerLayout.IsDrawerOpen((int)GravityFlags.Left);
//when open don't show anything
for (int i = 0; i < menu.Size (); i++)
menu.GetItem (i).SetVisible (!drawerOpen);
return base.OnPrepareOptionsMenu (menu);
}
示例13: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu(IMenu menu)
{
base.OnCreateOptionsMenu (menu);
_menu = menu;
MenuInflater inflater = this.MenuInflater;
inflater.Inflate (Resource.Menu.menu_past_history, menu);
if (!MApplication.getInstance().isConsultant || Utils.isDisableWaivedFee (constants.bookingInfo)) {
menu.GetItem (0).SubMenu.GetItem (4).SetVisible (false);
}
if (MApplication.getInstance ().isConsultant) {
menu.GetItem (0).SubMenu.GetItem (0).SetVisible (false);
}
return true;
}
示例14: OnPrepareOptionsMenu
public override bool OnPrepareOptionsMenu(IMenu menu)
{
menu.GetItem(0).SetEnabled(_imageNum > 0);
menu.GetItem(2).SetEnabled(_imageNum < _data.Images.Count - 1);
return base.OnPrepareOptionsMenu(menu);
}
示例15: OnCreateOptionsMenu
public override bool OnCreateOptionsMenu (IMenu menu)
{
MenuInflater.Inflate (Resource.Layout.order_menu, menu);
//Not sure about false as default
if (favChecked) {
menu.GetItem (0).SetIcon (Resource.Drawable.favchecked);
} else if (!favChecked) {
menu.GetItem (0).SetIcon (Resource.Drawable.fav);
}
return true;
}