📄 uielementbuilder.cs
字号:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Text;
using System.Windows.Controls;
using Microsoft.Practices.CompositeUI;
using Microsoft.Practices.CompositeUI.UIElements;
using Microsoft.Practices.CompositeUI.Windows;
namespace BankShell
{
/// <summary>
/// This is a temporary implementation that will be replaced with something
/// richer when we move it into the framework.
/// </summary>
public static class UIElementBuilder
{
// Loads the menu items from App.config and put them into the menu strip, hooking
// up the menu URIs for command dispatching.
public static void LoadFromConfig(WorkItem workItem)
{
ShellItemsSection section = (ShellItemsSection) ConfigurationManager.GetSection("shellitems");
foreach (MenuItemElement menuItem in section.MenuItems)
{
MenuItem uiMenuItem = menuItem.ToMenuItem();
workItem.UIExtensionSites[menuItem.Site].Add(uiMenuItem);
if (menuItem.Register)
{
workItem.UIExtensionSites.RegisterSite(menuItem.RegistrationSite, uiMenuItem);
}
if (!string.IsNullOrEmpty(menuItem.CommandName))
{
workItem.Commands[menuItem.CommandName].AddInvoker(uiMenuItem, "Click");
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -