public override ProgrammingElement Clone() { RotationFilter clone = new RotationFilter(); CopyTo(clone); return(clone); }
public override bool MatchAction(Reflex reflex, out object param) { bool result = false; param = null; TouchGestureFilter touchFilt = reflex.Data.GetFilterByType(typeof(TouchGestureFilter)) as TouchGestureFilter; if (touchFilt != null) { float rotation = touchFilt.DeltaRotation; for (int i = 0; i < reflex.Filters.Count; ++i) { Filter filter = reflex.Filters[i]; if (!(filter is RotationFilter)) { continue; } RotationFilter rotateFilt = filter as RotationFilter; // does the rotation direction violate any of the rotation filters? if (!rotateFilt.IsRotationValid(rotation)) { return(false); } } // If we've gotten here we're good. The rotation is in the // right direction for the filter so return true. result = true; } return(result); }
protected void CopyTo(RotationFilter clone) { base.CopyTo(clone); clone.direction = this.direction; }