本文整理汇总了C#中MenuType类的典型用法代码示例。如果您正苦于以下问题:C# MenuType类的具体用法?C# MenuType怎么用?C# MenuType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MenuType类属于命名空间,在下文中一共展示了MenuType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateMenuItems
/// <summary>
/// Creates menu items for the specified MenuDefinitionEntryCollection.
/// </summary>
/// <param name="commandManager">The CommandManager to use.</param>
/// <param name="menuDefinitionEntryCollection">The MenuDefinitionEntryCollection to create menu items for.</param>
/// <returns>The menu items.</returns>
public static MenuItem[] CreateMenuItems(CommandManager commandManager, MenuType menuType, MenuDefinitionEntryCollection menuDefinitionEntryCollection)
{
ArrayList menuItemArrayList = new ArrayList();
for (int position = 0; position < menuDefinitionEntryCollection.Count; position++)
{
MenuItem[] menuItems = menuDefinitionEntryCollection[position].GetMenuItems(commandManager, menuType);
if (menuItems != null)
menuItemArrayList.AddRange(menuItems);
}
// remove leading, trailing, and adjacent separators
for (int i = menuItemArrayList.Count - 1; i >= 0; i--)
{
if (((MenuItem)menuItemArrayList[i]).Text == "-")
{
if (i == 0 || // leading
i == menuItemArrayList.Count - 1 || // trailing
((MenuItem)menuItemArrayList[i - 1]).Text == "-") // adjacent
{
menuItemArrayList.RemoveAt(i);
}
}
}
return (menuItemArrayList.Count == 0) ? null : (MenuItem[])menuItemArrayList.ToArray(typeof(MenuItem));
}
示例2: MapEditorTabsLogic
public MapEditorTabsLogic(Widget widget, WorldRenderer worldRenderer)
{
var tabContainer = widget.Get("MAP_EDITOR_TAB_CONTAINER");
var tilesTab = tabContainer.Get<ButtonWidget>("TILES_TAB");
tilesTab.IsHighlighted = () => menuType == MenuType.Tiles;
tilesTab.OnClick = () => { menuType = MenuType.Tiles; };
var overlaysTab = tabContainer.Get<ButtonWidget>("OVERLAYS_TAB");
overlaysTab.IsHighlighted = () => menuType == MenuType.Layers;
overlaysTab.OnClick = () => { menuType = MenuType.Layers; };
var actorsTab = tabContainer.Get<ButtonWidget>("ACTORS_TAB");
actorsTab.IsHighlighted = () => menuType == MenuType.Actors;
actorsTab.OnClick = () => { menuType = MenuType.Actors; };
var tileContainer = widget.Parent.Get<ContainerWidget>("TILE_WIDGETS");
tileContainer.IsVisible = () => menuType == MenuType.Tiles;
var layerContainer = widget.Parent.Get<ContainerWidget>("LAYER_WIDGETS");
layerContainer.IsVisible = () => menuType == MenuType.Layers;
var actorContainer = widget.Parent.Get<ContainerWidget>("ACTOR_WIDGETS");
actorContainer.IsVisible = () => menuType == MenuType.Actors;
}
示例3: PodcastViewModel
public PodcastViewModel(MenuType item)
{
this.item = item;
image = "hm_full.jpg";
Title = "Blogs";
}
示例4: NavigateAsync
public async Task NavigateAsync(MenuType id)
{
Page newPage;
if (!Pages.ContainsKey(id))
{
switch (id)
{
case MenuType.Dashboard:
DashboardPage dashboard = new DashboardPage ();
dashboard.BindingContext = new DashboardViewModel(){ Navigation = this.Navigation };
Pages.Add(id, new EmanagementNavigationPage(dashboard));
break;
}
}
newPage = Pages[id];
if(newPage == null)
return;
//pop to root for Windows Phone
if (Detail != null && Device.OS == TargetPlatform.WinPhone)
{
await Detail.Navigation.PopToRootAsync();
}
Detail = newPage;
if(Device.Idiom != TargetIdiom.Tablet)
IsPresented = false;
}
示例5: GetCheckbox
public static CheckBox GetCheckbox(MenuType menuType, string uniqueName)
{
CheckBox checkbox = getMenu(menuType).Get<CheckBox>(uniqueName);
if (checkbox == null)
Console.WriteLine("Checkbox " + uniqueName + " does not exist under this menu type: " + menuType.ToString());
return checkbox;
}
示例6: Init
public void Init(MenuType menuType, object obj, Action<object> acceptedCallback)
{
this.m_MenuType = menuType;
this.m_Object = obj;
this.m_AcceptedCallback = acceptedCallback;
this.m_IsInitialized = true;
}
示例7: NavigateAsync
public async Task NavigateAsync(MenuType id)
{
Page newPage;
if (!Pages.ContainsKey(id))
{
switch (id)
{
case MenuType.About:
Pages.Add(id, new AppointyNavigationPage(new AboutPage()));
break;
case MenuType.Hanselminutes:
Pages.Add(id, new AppointyNavigationPage(new PodcastPage(id)));
break;
}
}
newPage = Pages[id];
if(newPage == null)
return;
//pop to root for Windows Phone
if (Detail != null && Device.OS == TargetPlatform.WinPhone)
{
await Detail.Navigation.PopToRootAsync();
}
Detail = newPage;
if(Device.Idiom != TargetIdiom.Tablet)
IsPresented = false;
}
示例8: ProfileOption
public ProfileOption(MenuType menuType, string id, OptionType type, string value)
{
MenuType = menuType;
Id = id;
Type = type;
Value = value;
}
示例9: XisMenu
public XisMenu(EA.Repository repository, EA.Diagram diagram, XisWidget parent, string name, MenuType type)
: base(repository, parent)
{
Element = XisWebHelper.CreateXisMenu(parent.Element, name, type);
Groups = new List<XisMenuGroup>();
Items = new List<XisMenuItem>();
}
示例10: Add
public static void Add(MenuType Type)
{
if (Current != null)
Current.Visibility = Visibility.Hidden;
MenuStack.Push(Menus[Type]);
currentChanged();
}
示例11: setMenuType
// Method that parses the string 'type' into a valid MenuType.
// If 'type' is invalid, an error is printed in console and the
// application quits when escape is pressed (not yet implemented)
private void setMenuType(string type)
{
MenuType tempType;
if (Enum.TryParse(type, out tempType))
menuType = tempType;
/*else
IMPLEMENT ERROR CLASS AND PRINT TO CONSOLE
*/
}
示例12: NavigateAsync
public async Task NavigateAsync(MenuType id)
{
Page newPage;
if (!Pages.ContainsKey(id))
{
switch (id)
{
case MenuType.Sales:
Pages.Add(id, new CRMNavigationPage(new SalesDashboardPage
{
Title = TextResources.MainTabs_Sales,
Icon = new FileImageSource { File = "sales.png" }
}));
break;
case MenuType.Customers:
Pages.Add(id, new CRMNavigationPage(new CustomersPage
{
BindingContext = new CustomersViewModel(Navigation),
Title = TextResources.MainTabs_Customers,
Icon = new FileImageSource { File = "customers.png" }
}));
break;
case MenuType.Products:
Pages.Add(id, new CRMNavigationPage(new CategoryListPage
{
BindingContext = new CategoriesViewModel(navigation: Navigation),
Title = TextResources.MainTabs_Products,
Icon = new FileImageSource { File = "products.png" }
}));
break;
case MenuType.About:
Pages.Add(id, new CRMNavigationPage(new AboutPage
{
Title = "About",
Icon = new FileImageSource { File = "about.png" }
}));
break;
}
}
newPage = Pages[id];
if (newPage == null)
return;
//pop to root for Windows Phone
if (Detail != null && Device.OS == TargetPlatform.WinPhone)
{
await Detail.Navigation.PopToRootAsync();
}
Detail = newPage;
if (Device.Idiom != TargetIdiom.Tablet)
IsPresented = false;
}
示例13: Navigate
internal void Navigate(MenuType type, bool gotoState)
{
switch (type)
{
case MenuType.Home:
SetPageTitle("Home");
SetActive(type);
SwapPage(new home());
break;
case MenuType.Imprint:
SetPageTitle("Impressum");
SetActive(type);
SwapPage(new ImprintPage());
break;
case MenuType.KopierService:
SetPageTitle("Kopierservice Werlsee");
if (gotoState)
{
VisualStateManager.GoToState(MenuKopierService, "MouseOver", true);
}
SetActive(type);
SwapPage(new KopierServicePage());
break;
case MenuType.Wasserbau:
if (gotoState)
{
VisualStateManager.GoToState(MenuNbw, "MouseOver", true);
}
SetPageTitle("Niederbarnimer Wasserbau");
SetActive(type);
SwapPage(new WasserbauPage());
break;
case MenuType.YachtCharter:
if (gotoState)
{
VisualStateManager.GoToState(MenuYachtCharter, "MouseOver", true);
}
SetPageTitle("Yachtcharter Süd/Ost");
SetActive(type);
SwapPage(new YachtCharterPage());
break;
case MenuType.Contact:
SetPageTitle("Kontakt");
SetActive(type);
SwapPage(new ContactPage());
break;
case MenuType.Services:
SetPageTitle("Übersicht");
SetActive(type);
SwapPage(new OverviewPage());
break;
default:
break;
}
}
示例14: MasterView
public MasterView(MenuViewModel viewModel)
{
this.BindingContext = viewModel;
this.Title = "Title";
var layout = new StackLayout { Spacing = 0 };
var listView = new ListView();
var cell = new DataTemplate(typeof(ImageCell));
cell.SetBinding(TextCell.TextProperty, MenuViewModel.TitlePropertyName);
cell.SetBinding(ImageCell.ImageSourceProperty, "Icon");
listView.ItemTemplate = cell;
listView.ItemsSource = viewModel.MenuItems;
if (about == null)
about = new AboutView();
PageSelection = about;
listView.ItemSelected += (sender, args) =>
{
var menuItem = listView.SelectedItem as HomeMenuItem;
menuType = menuItem.MenuType;
switch (menuItem.MenuType)
{
case MenuType.Home:
if (home == null)
home = new HomeView();
PageSelection = home;
break;
case MenuType.About:
if (about == null)
about = new AboutView();
PageSelection = about;
break;
case MenuType.Feedback:
if (feedback == null)
feedback = new FeedbackView();
PageSelection = feedback;
break;
}
};
listView.SelectedItem = viewModel.MenuItems[0];
layout.Children.Add(listView);
this.Content = layout;
}
示例15: Create
/// <summary>
/// 新增選單
/// </summary>
/// <returns></returns>
public ActionResult Create(Guid? parentId, MenuType typeOpt = MenuService.DefaultType)
{
var menu = new Menu()
{
Type = (int)typeOpt
};
ViewBag.infoList = GetSelect(null, parentId, typeOpt);
ViewBag.TypeOpt = typeOpt;
ViewBag.CurrentId = parentId;
return View(menu);
}