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


C# MouseButton.ToString方法代码示例

本文整理汇总了C#中MouseButton.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# MouseButton.ToString方法的具体用法?C# MouseButton.ToString怎么用?C# MouseButton.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MouseButton的用法示例。


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

示例1: widget_EventMouseButtonReleased

 static void widget_EventMouseButtonReleased(Widget _sender, int _left, int _top, MouseButton _id)
 {
     Export.DebugOut("EventMouseMove  _left=" + _left.ToString() + "   _top=" + _top.ToString() + "   _id=" + _id.ToString());
 }
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:4,代码来源:Test_Widget.cs

示例2: widget_EventMouseDrag

 static void widget_EventMouseDrag(Widget _sender, int _left, int _top, MouseButton _id)
 {
     Gui.Instance.Log("TestApp", LogLevel.Info, "EventMouseDrag  _left=" + _left.ToString() + "   _top=" + _top.ToString() + "   _id=" + _id.ToString());
 }
开发者ID:nice1378,项目名称:mygui,代码行数:4,代码来源:Test_Widget.cs

示例3: CreateHierarchicalMenu

        /// <summary>
        /// Creates a contextual menu and associates it to the left- or right-click command.  That method will bind a new
        /// <see cref="ObservableHierarchicalCommandObject"/> to the menu; essentially, you call this overload only when you want
        /// to provide you own template and style for the menu.  Otherwise, call the overload that takes a single argument, or pass
        /// a <see cref="StandardCommandContextMenu"/> which has all the templates it needs to build the menu correctly.
        /// </summary>
        /// <param name="mouseClickButton">Either <see cref="MouseButton.Left"/> or <see cref="MouseButton.Right"/>.  The contextual menu will
        /// be associated with that button's click event.</param>
        /// <param name="menu">A context menu.  By default, you should use <see cref="StandardCommandContextMenu"/>.</param>
        /// <exception cref="ArgumentException">Raised if <paramref name="mouseClickButton"/> is neither <see cref="MouseButton.Left"/> nor <see cref="MouseButton.Right"/>.</exception>
        /// <exception cref="ArgumentNullException">Raised if <paramref name="menu"/> is null.</exception>
        public ObservableHierarchicalCommandObject CreateHierarchicalMenu(MouseButton mouseClickButton, ContextMenu menu)
        {
            if (mouseClickButton != MouseButton.Left && mouseClickButton != MouseButton.Right)
                throw new ArgumentException(string.Format("Mouse button {0} not supported.", mouseClickButton.ToString()));

            if (menu == null) throw new ArgumentNullException("menu");

            ObservableHierarchicalCommandObject menuItems;
            ContextMenuCommand cmd;

            menu.Placement = System.Windows.Controls.Primitives.PlacementMode.MousePoint;
            cmd = new ContextMenuCommand(menu);
            menuItems = new ObservableHierarchicalCommandObject();
            menu.ItemsSource = menuItems.Children;

            if (mouseClickButton == MouseButton.Left)
            {
                _leftClickMenu = menuItems;
                this.LeftClickCommand = cmd;
            }
            else
            {
                _rightClickMenu = menuItems;
                this.RightClickCommand = cmd;
            }
            return menuItems;
        }
开发者ID:SignedUp,项目名称:omni-foundation,代码行数:38,代码来源:NotifyIconPresenter.cs

示例4: Cast

        static Mouse.Button Cast(MouseButton b)
        {
            string name = b.ToString().Split('.').Last();

            string[] names = typeof(Mouse).GetNestedType("Button").GetEnumNames();

            for (int i = 0; i < names.Length; ++i)
                if (names[i].Equals(name))
                    return (Mouse.Button)i;

            return Mouse.Button.ButtonCount;
        }
开发者ID:Kedreals,项目名称:MicrosoftGameJam2015AwesomeHurray,代码行数:12,代码来源:MouseControler.cs

示例5: widget_EventMouseButtonPressed

 static void widget_EventMouseButtonPressed(Widget _sender, int _left, int _top, MouseButton _id)
 {
     ExampleApplication.DebugOut("EventMouseButtonPressed  _left=" + _left.ToString() + "   _top=" + _top.ToString() + "   _id=" + _id.ToString());
 }
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:4,代码来源:Test_Widget.cs

示例6: SetMouseHoldTrigger

		public void SetMouseHoldTrigger(MouseButton newButton, TriggerLayoutView newTrigger)
		{
			trigger = newTrigger;
			FillBoxWithMouseEnum();
			FillBoxWithInputTypeEnum();
			trigger.TriggerType.SelectedItem = InputType.MouseHold.ToString();
			trigger.TriggerKey.SelectedItem = newButton.ToString();
			trigger.TriggerState.SelectedItem = "";
		}
开发者ID:whztt07,项目名称:DeltaEngine,代码行数:9,代码来源:InputNewTriggerEditor.cs


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