/// <summary> /// - Processes a character event into an Action that occurs while in the DcsEntry state. /// Events in this state will: /// 1. Ignore C0 control characters /// 2. Ignore Delete characters /// 3. Begin to ignore all remaining characters when an invalid character is detected (DcsIgnore) /// 4. Store parameter data /// 5. Collect Intermediate characters /// 6. Dispatch the Final character in preparation for parsing the data string /// DCS sequences are structurally almost the same as CSI sequences, just with an /// extra data string. It's safe to reuse CSI functions for /// determining if a character is a parameter, delimiter, or invalid. /// </summary> /// <param name="ch"></param> private void EventDCSEntry(byte ch) { if (ASCIIChars.IsC0Code(ch)) { this.ActionIgnore(ch); } else if (ASCIIChars.IsDelete(ch)) { this.ActionIgnore(ch); } else if (ASCIIChars.IsCSIInvalid(ch)) { this.EnterDCSIgnore(); } else if (ASCIIChars.IsNumericParamValue(ch) || ASCIIChars.IsParameterDelimiter(ch)) { this.ActionParam(ch); this.EnterDCSParam(); } else if (ASCIIChars.IsIntermediate(ch)) { this.ActionCollect(ch); this.EnterDCSIntermediate(); } else { this.ActionDCSDispatch(ch); } }
/// <summary> /// - Processes a character event into an Action that occurs while in the CsiEntry state. /// Events in this state will: /// 1. Execute C0 control characters /// 2. Ignore Delete characters /// 3. Collect Intermediate characters /// 4. Begin to ignore all remaining parameters when an invalid character is detected (CsiIgnore) /// 5. Store parameter data /// 6. Collect Control Sequence Private markers /// 7. Dispatch a control sequence with parameters for action /// </summary> /// <param name="ch"></param> private void EventCSIEntry(byte ch) { if (ASCIIChars.IsC0Code(ch)) { this.ActionExecute(ch); } else if (ASCIIChars.IsDelete(ch)) { this.ActionIgnore(ch); } else if (ASCIIChars.IsIntermediate(ch)) { this.ActionCollect(ch); this.EnterCSIIntermediate(); } else if (ASCIIChars.IsCSIInvalid(ch)) { this.EnterCSIIgnore(); } else if (ASCIIChars.IsNumericParamValue(ch) || ASCIIChars.IsParameterDelimiter(ch)) { this.ActionParam(ch); this.EnterCSIParam(); } else if (ASCIIChars.IsCSIPrivateMarker(ch)) { this.ActionCollect(ch); this.EnterCSIParam(); } else { this.ActionCSIDispatch(ch); this.EnterGround(); } }