/// <summary> /// /// </summary> /// <param name="comparedState"></param> /// <returns></returns> public override bool IsSame(MaskManagerState comparedState) { if (comparedState == null) { return(false); } if (base.GetType() != comparedState.GetType()) { throw new NotImplementedException("Internal error"); } RegExpMaskManagerState state = (RegExpMaskManagerState)comparedState; if (EditText != state.EditText) { return(false); } if (CursorPosition != state.CursorPosition) { return(false); } if (SelectionAnchor != state.SelectionAnchor) { return(false); } return(true); }
/// <summary> /// /// </summary> /// <param name="comparedState"></param> /// <returns></returns> public override bool IsSame(MaskManagerState comparedState) { if (comparedState == null) { return(false); } if (base.GetType() != typeof(LegacyMaskManagerState)) { throw new NotImplementedException("Internal error"); } if (comparedState.GetType() != typeof(LegacyMaskManagerState)) { throw new InvalidOperationException("Internal error"); } LegacyMaskManagerState state = (LegacyMaskManagerState)comparedState; if (this.CursorPositionElement != state.CursorPositionElement) { return(false); } if (this.CursorPositionInsideElement != state.CursorPositionInsideElement) { return(false); } if (this.SelectionAnchorElement != state.SelectionAnchorElement) { return(false); } if (this.SelectionAnchorInsideElement != state.SelectionAnchorInsideElement) { return(false); } if (!object.ReferenceEquals(this.Info, state.Info)) { throw new InvalidOperationException("Internal error"); } if (this.Elements.Length != state.Elements.Length) { throw new InvalidOperationException("Internal error"); } for (int i = 0; i < this.Elements.Length; i++) { if (this.Elements[i] != state.Elements[i]) { return(false); } } return(true); }