本文整理汇总了C#中IButton.GetPressedShortlyTrigger方法的典型用法代码示例。如果您正苦于以下问题:C# IButton.GetPressedShortlyTrigger方法的具体用法?C# IButton.GetPressedShortlyTrigger怎么用?C# IButton.GetPressedShortlyTrigger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IButton
的用法示例。
在下文中一共展示了IButton.GetPressedShortlyTrigger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConnectMoveNextAndToggleOffWith
public static IStateMachine ConnectMoveNextAndToggleOffWith(this IStateMachine stateMachineActuator, IButton button)
{
button.GetPressedShortlyTrigger().Attach(() => stateMachineActuator.SetNextState());
if (stateMachineActuator.GetSupportsOffState())
{
button.GetPressedLongTrigger().Attach(() => stateMachineActuator.SetState(BinaryStateId.Off));
}
return stateMachineActuator;
}
示例2: ConnectWith
public static IRollerShutter ConnectWith(
this IRollerShutter rollerShutter,
IButton upButton,
IButton downButton)
{
if (rollerShutter == null) throw new ArgumentNullException(nameof(rollerShutter));
if (upButton == null) throw new ArgumentNullException(nameof(upButton));
if (downButton == null) throw new ArgumentNullException(nameof(downButton));
upButton.GetPressedShortlyTrigger().Attach(() => HandleBlindButtonPressedEvent(rollerShutter, RollerShutterStateId.MovingUp));
downButton.GetPressedShortlyTrigger().Attach(() => HandleBlindButtonPressedEvent(rollerShutter, RollerShutterStateId.MovingDown));
return rollerShutter;
}
开发者ID:chkr1011,项目名称:CK.HomeAutomation,代码行数:14,代码来源:RollerShutterWithRollerShutterButtonsConnector.cs
示例3: ConnectToggleAction
private static void ConnectToggleAction(IButton button, IStateMachine actuator, ButtonPressedDuration pressedDuration)
{
if (pressedDuration == ButtonPressedDuration.Short)
{
button.GetPressedShortlyTrigger().Attach(actuator.GetSetNextStateAction());
}
else if (pressedDuration == ButtonPressedDuration.Long)
{
button.GetPressedLongTrigger().Attach(actuator.GetSetNextStateAction());
}
else
{
throw new NotSupportedException();
}
}
示例4: ConnectToggleActionWith
public LogicalBinaryStateActuator ConnectToggleActionWith(IButton button, ButtonPressedDuration pressedDuration = ButtonPressedDuration.Short)
{
if (button == null) throw new ArgumentNullException(nameof(button));
if (pressedDuration == ButtonPressedDuration.Short)
{
button.GetPressedShortlyTrigger().Attach(() => ToggleState());
}
else if (pressedDuration == ButtonPressedDuration.Long)
{
button.GetPressedLongTrigger().Attach(() => ToggleState());
}
else
{
throw new NotSupportedException();
}
return this;
}