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


C# MenuType类代码示例

本文整理汇总了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));
        }
开发者ID:gmilazzoitag,项目名称:OpenLiveWriter,代码行数:32,代码来源:MenuBuilder.cs

示例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;
        }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:25,代码来源:MapEditorTabsLogic.cs

示例3: PodcastViewModel

        public PodcastViewModel(MenuType item)
        {
            this.item = item;
			image = "hm_full.jpg";
			Title = "Blogs";
               
        }
开发者ID:Shankulkarni,项目名称:AppointyBlog,代码行数:7,代码来源:PodcastViewModel.cs

示例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;
		}
开发者ID:Manuss20,项目名称:e-management,代码行数:31,代码来源:RootPage.cs

示例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;
 }
开发者ID:Sicryption,项目名称:EloBuddyAddons,代码行数:7,代码来源:MenuHandler.cs

示例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;
 }
开发者ID:randomize,项目名称:VimConfig,代码行数:7,代码来源:FlexibleMenuModifyItemUI.cs

示例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;
        }
开发者ID:Shankulkarni,项目名称:AppointyBlog,代码行数:32,代码来源:RootPage.cs

示例8: ProfileOption

 public ProfileOption(MenuType menuType, string id, OptionType type, string value)
 {
     MenuType = menuType;
     Id = id;
     Type = type;
     Value = value;
 }
开发者ID:BEEBEEISADOG,项目名称:OKTRAIO,代码行数:7,代码来源:ChampionProfiles.cs

示例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>();
 }
开发者ID:theedward,项目名称:xisweb,代码行数:7,代码来源:XisMenu.cs

示例10: Add

        public static void Add(MenuType Type)
        {
            if (Current != null)
                Current.Visibility = Visibility.Hidden;

            MenuStack.Push(Menus[Type]);
            currentChanged();
        }
开发者ID:Wronq,项目名称:RocknSpace,代码行数:8,代码来源:MenuManager.cs

示例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
      */
 }
开发者ID:zeOxx,项目名称:SideSouler,代码行数:12,代码来源:MenuScreen.cs

示例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;
        }
开发者ID:rsaggio,项目名称:app-crm,代码行数:56,代码来源:RootPage.cs

示例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;
     }
 }
开发者ID:crystalbyte,项目名称:aquapool-web,代码行数:55,代码来源:Root.xaml.cs

示例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;
        }
开发者ID:pacificIT,项目名称:SimpleMasterDetailTabbed,代码行数:55,代码来源:MasterView.cs

示例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);
 }
开发者ID:creatidea-tw,项目名称:Ci.Template,代码行数:15,代码来源:MenuController.cs


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