本文整理汇总了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());
}
示例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());
}
示例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;
}
示例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;
}
示例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());
}
示例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 = "";
}