internal static IEnumerable <GestureDefinition> Parse( DSL.WhenElement.Value whenElement, DSL.OnElement.Value onElement, DSL.IfDoubleTriggerButtonElement.Value ifDoubleTriggerButtonElement) { if (ifDoubleTriggerButtonElement.beforeElements.Count == 0 && ifDoubleTriggerButtonElement.doElements.Count == 0 && ifDoubleTriggerButtonElement.afterElements.Count == 0 ) { yield return(new OnButtonWithIfButtonGestureDefinition(whenElement.func, onElement.button, ifDoubleTriggerButtonElement.button, null, null, null)); } else { foreach (var elm in ifDoubleTriggerButtonElement.beforeElements) { yield return(new OnButtonWithIfButtonGestureDefinition(whenElement.func, onElement.button, ifDoubleTriggerButtonElement.button, elm.func, null, null)); } foreach (var elm in ifDoubleTriggerButtonElement.doElements) { yield return(new OnButtonWithIfButtonGestureDefinition(whenElement.func, onElement.button, ifDoubleTriggerButtonElement.button, null, elm.func, null)); } foreach (var elm in ifDoubleTriggerButtonElement.afterElements) { yield return(new OnButtonWithIfButtonGestureDefinition(whenElement.func, onElement.button, ifDoubleTriggerButtonElement.button, null, null, elm.func)); } } }
internal static IEnumerable <GestureDefinition> Parse( DSL.WhenElement.Value whenElement, DSL.OnElement.Value onElement) { if (onElement.ifSingleTriggerButtonElements.Count == 0 && onElement.ifDoubleTriggerButtonElements.Count == 0 && onElement.ifStrokeElements.Count == 0) { yield return(new OnButtonGestureDefinition(whenElement.func, onElement.button)); } else { foreach (var elm in onElement.ifSingleTriggerButtonElements) { foreach (var def in Parse(whenElement, onElement, elm)) { yield return(def); } } foreach (var elm in onElement.ifDoubleTriggerButtonElements) { foreach (var def in Parse(whenElement, onElement, elm)) { yield return(def); } } foreach (var elm in onElement.ifStrokeElements) { foreach (var def in Parse(whenElement, onElement, elm)) { yield return(def); } } } }
internal static IEnumerable <GestureDefinition> Parse( DSL.WhenElement.Value whenElement, DSL.OnElement.Value onElement, DSL.IfStrokeElement.Value ifStrokeElement) { var stroke = Helper.Convert(ifStrokeElement.moves); if (ifStrokeElement.doElements.Count == 0) { yield return(new OnButtonWithIfStrokeGestureDefinition(whenElement.func, onElement.button, stroke, null)); } else { foreach (var doElement in ifStrokeElement.doElements) { yield return(new OnButtonWithIfStrokeGestureDefinition(whenElement.func, onElement.button, stroke, doElement.func)); } } }