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


C# CommandBar类代码示例

本文整理汇总了C#中CommandBar的典型用法代码示例。如果您正苦于以下问题:C# CommandBar类的具体用法?C# CommandBar怎么用?C# CommandBar使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: AddBottomAppBar

        public static void AddBottomAppBar(Page myPage)
        {
            var commandBar = new CommandBar();
            var searchButton = new AppBarButton
            {
                Label = "Поиск",
                Icon = new SymbolIcon(Symbol.Find),
            };

            var aboutButton = new AppBarButton
            {
                Label = "О прилож.",
                Icon = new SymbolIcon(Symbol.Help),
            };

            if (RootFrame != null)
            {
                searchButton.Click += SearchButtonClick;
                aboutButton.Click += AboutButtonClick;
            }

            commandBar.PrimaryCommands.Add(searchButton);
            commandBar.PrimaryCommands.Add(aboutButton);
            myPage.BottomAppBar = commandBar;
        }
开发者ID:nastachka,项目名称:pdd,代码行数:25,代码来源:LayoutObjectFactory.cs

示例2: CreateUIForChoiceGroupCollection

		public void CreateUIForChoiceGroupCollection(ChoiceGroupCollection groupCollection)
		{
			bool weCreatedTheBarManager = GetCommandBarManager();

			foreach(ChoiceGroup group in groupCollection)
			{
				CommandBar toolbar = new CommandBar(CommandBarStyle.ToolBar);
				toolbar.Tag = group;
				group.ReferenceWidget = toolbar;

				//whereas the system was designed to only populate groups when
				//the OnDisplay method is called on a group,
				//this particular widget really really wants to have all of the buttons
				//populated before it gets added to the window.
				//therefore, we don't hope this up but instead call a bogus OnDisplay() now.
				//toolbar.VisibleChanged  += new System.EventHandler(group.OnDisplay);

				group.OnDisplay(null,null);

				this.m_commandBarManager.CommandBars.Add(toolbar);
			}

			if(weCreatedTheBarManager)
				m_window.Controls.Add(m_commandBarManager);
		}
开发者ID:bbriggs,项目名称:FieldWorks,代码行数:25,代码来源:ReBarAdapter.cs

示例3: ToAppCommandBar

        public static CommandBar ToAppCommandBar(this IContextMenu source, CommandBar menu, bool isSecondary)
        {
            var commandsVector = isSecondary ? menu.SecondaryCommands : menu.PrimaryCommands;
            commandsVector.Clear();

            foreach(var item in source.Items)
            {
                AppBarButton button = new AppBarButton();
                commandsVector.Add(button);
                button.Label = item.Header;
                button.Command = item.Command;
                button.CommandParameter = item.CommandParameter;

                if (!string.IsNullOrEmpty(item.Icon))
                {
                    var icon = new SymbolIcon();
                    icon.Symbol = (Symbol)System.Enum.Parse(typeof(Symbol), item.Icon);
                    button.Icon = icon;
                }
                else
                    button.Icon = new SymbolIcon(Symbol.Emoji);
            }

            return menu;
        }
开发者ID:jarkkom,项目名称:awfuldotnet,代码行数:25,代码来源:IContextMenuExtensions.cs

示例4: initiateCommandBar

        private void initiateCommandBar()
        {
            CommandBar bar = new CommandBar();
            AppBarButton logou = new AppBarButton() { Icon = new SymbolIcon(Symbol.Cancel), Label = "Log out" };
            logou.Click += logout;
            AppBarButton refr = new AppBarButton() { Icon = new BitmapIcon() { UriSource = new Uri("ms-appx:Assets/Buttons/appbar.refresh.png") }, Label = "Refresh" };
            refr.Click += refresh;
            AppBarButton search = new AppBarButton() { Icon = new SymbolIcon(Symbol.Find), Label = "Search" };
            search.Click += search_Click;

            AppBarButton ideas = new AppBarButton() { Label = "Suggest a feature" };
            ideas.Click += openForum;
            AppBarButton bugs = new AppBarButton() { Label = "Report a bug" };
            ideas.Click += openForum;
            AppBarButton contact = new AppBarButton() { Label = "Contact Developer" };
            contact.Click += sendEmail;

            bar.PrimaryCommands.Add(refr);
            bar.PrimaryCommands.Add(search);
            bar.PrimaryCommands.Add(logou);

            bar.SecondaryCommands.Add(ideas);
            bar.SecondaryCommands.Add(bugs);
            bar.SecondaryCommands.Add(contact);

            bar.ClosedDisplayMode = AppBarClosedDisplayMode.Minimal;

            BottomAppBar = bar;
        }
开发者ID:newnottakenname,项目名称:FollowshowsWP,代码行数:29,代码来源:MainPage.xaml.cs

示例5: ApplicationWindow

        public ApplicationWindow()
        {
            this.Icon = new Icon(this.GetType().Assembly.GetManifestResourceStream("Resourcer.Application.ico"));
            this.Font = new Font("Tahoma", 8.25f);
            this.Text = (this.GetType().Assembly.GetCustomAttributes(typeof(System.Reflection.AssemblyTitleAttribute), false)[0] as System.Reflection.AssemblyTitleAttribute).Title;
            this.Size = new Size(480, 600);
            this.MinimumSize = new Size (240, 300);

            this.resourceBrowser = new ResourceBrowser();
            this.resourceBrowser.Dock = DockStyle.Fill;
            this.Controls.Add(this.resourceBrowser);

            this.verticalSplitter = new Splitter ();
            this.verticalSplitter.Dock = DockStyle.Bottom;
            this.verticalSplitter.BorderStyle = BorderStyle.None;
            this.Controls.Add(this.verticalSplitter);

            this.resourceViewer = new ResourcerViewer();
            this.resourceViewer.Dock = DockStyle.Bottom;
            this.resourceViewer.Height = 100;
            this.Controls.Add(this.resourceViewer);

            this.statusBar = new StatusBar();
            this.Controls.Add(this.statusBar);

            this.commandBarManager = new CommandBarManager();
            this.menuBar = new CommandBar(this.commandBarManager, CommandBarStyle.Menu);
            this.commandBarManager.CommandBars.Add(this.menuBar);
            this.toolBar = new CommandBar(this.commandBarManager, CommandBarStyle.ToolBar);
            this.commandBarManager.CommandBars.Add(this.toolBar);
            this.Controls.Add(this.commandBarManager);
        }
开发者ID:modulexcite,项目名称:Resourcer,代码行数:32,代码来源:ApplicationWindow.cs

示例6: SetCommandBar

 public static void SetCommandBar(DependencyObject obj, CommandBar value)
 {
     if (obj == null)
     {
         throw new ArgumentNullException("obj");
     }
     obj.SetValue(CommandBarProperty, value);
 }
开发者ID:ridomin,项目名称:waslibs,代码行数:8,代码来源:ShellControl.Static.cs

示例7: RegisterGUI

			public override bool RegisterGUI(Command vsCommand, CommandBar vsCommandbar, bool toolBarOnly)
			{
				if(!toolBarOnly)
				{
					_RegisterGuiContext(vsCommand, "Solution");
				}
				return true;
			}
开发者ID:transformersprimeabcxyz,项目名称:_To-Do-unreal-3D-niftyplugins-ben-marsh,代码行数:8,代码来源:P4DiffSolution.cs

示例8: GetSolutionCommandBar

 public static CommandBar GetSolutionCommandBar(this DTE2 application)
 {
     if (_solutionCommandBar == null)
     {
         _solutionCommandBar = ((CommandBars)application.CommandBars)["Solution"];
     }
     return _solutionCommandBar;
 }
开发者ID:ssekoguchi,项目名称:vsaddin11,代码行数:8,代码来源:DTE2Extensions.cs

示例9: GetProjectCommandBar

 public static CommandBar GetProjectCommandBar(this DTE2 application)
 {
     if (_projectCommandBar == null)
     {
         _projectCommandBar = ((CommandBars)application.CommandBars)["Project"];
     }
     return _projectCommandBar;
 }
开发者ID:ssekoguchi,项目名称:vsaddin11,代码行数:8,代码来源:DTE2Extensions.cs

示例10: GetCodeWindowCommandBar

 public static CommandBar GetCodeWindowCommandBar(this DTE2 application)
 {
     if (_codeWindowCommandBar == null)
     {
         _codeWindowCommandBar = ((CommandBars)application.CommandBars)["Code Window"];
     }
     return _codeWindowCommandBar;
 }
开发者ID:ssekoguchi,项目名称:vsaddin11,代码行数:8,代码来源:DTE2Extensions.cs

示例11: RegisterGUI

		public virtual bool RegisterGUI(Command vsCommand, CommandBar vsCommandbar, bool toolBarOnly)
		{
			// The default command is registered in the toolbar.
			if(IconIndex >= 0 && toolBarOnly)
				vsCommand.AddControl(vsCommandbar, vsCommandbar.Controls.Count + 1);

			return true;
		}
开发者ID:transformersprimeabcxyz,项目名称:_To-Do-unreal-3D-niftyplugins-ben-marsh,代码行数:8,代码来源:CommandBase.cs

示例12: Init

		public System.Windows.Forms.Control Init (System.Windows.Forms.Form window,  IImageCollection smallImages, IImageCollection largeImages, Mediator mediator)
		{
			m_window = window;
			m_smallImages = smallImages;
			m_largeImages = largeImages;
			m_menuBar = new CommandBar(CommandBarStyle.Menu);

			return null; //this is not available yet. caller should call GetCommandBarManager() after CreateUIForChoiceGroupCollection() is called
		}
开发者ID:sillsdev,项目名称:FieldWorks,代码行数:9,代码来源:RebarMenuAdapter.cs

示例13: CommandRegistry

 public CommandRegistry(Plugin plugin, CommandBar commandBar, Guid packageGuid, Guid cmdGroupGuid)
 {
     mCommands = new Dictionary<string, CommandBase>();
     mCommandsById = new Dictionary<uint, CommandBase>();
     mPlugin = plugin;
     mCommandBar = commandBar;
     mPackageGuid = packageGuid;
     mCmdGroupGuid = cmdGroupGuid;
 }
开发者ID:Nexuapex,项目名称:niftyplugins,代码行数:9,代码来源:CommandRegistry.cs

示例14: AddButtonToCmdBar

        public CommandBarButton AddButtonToCmdBar(CommandBar cmdBar, int beforeIndex, string caption, string tooltip)
        {
            CommandBarButton button = cmdBar.Controls.Add(MsoControlType.msoControlButton,
                        Type.Missing, Type.Missing, beforeIndex, true) as CommandBarButton;
            button.Caption = caption;
            button.TooltipText = tooltip;

            return button;
        }
开发者ID:schnarf,项目名称:ClangVSx,代码行数:9,代码来源:DTEHelper.cs

示例15: NewAlarmView

        public NewAlarmView()
        {
            this.InitializeComponent();

            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
            //defaultViewModel.Add("newAlarm", new NewAlarmViewModel());
            alarmViewCommandBar = BottomAppBar as CommandBar;
        }
开发者ID:mkrzem,项目名称:AlarmWP,代码行数:10,代码来源:AlarmView.xaml.cs


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