TextEditor2.Message.ControlCodesToTags C# (CSharp) Method

ControlCodesToTags() public method

public ControlCodesToTags ( ) : void
return void
        public void ControlCodesToTags()
        {
            //Convert control codes into control tags (binary to "<>")

            for (int i = 0; i < charData.Count; i++)
            {
                //Control codes are signaled by a value of 0x1A
                //If this isn't triggered, we just keep checking
                //the other chars

                if ((byte)charData[i] != 0x1A)
                {
                    continue;
                }

                //Otherwise, we get into the meat of code parsing
                //Call the proper function for the code size

                //We're going to use i as our reference point
                //for the start of the code, for both getting
                //the actual type and deleting it once we insert
                //the control tag.

                switch ((byte)charData[i + 1])
                {
                    case (byte)ControlCodeSizes.FiveBytes:
                        ConvertFiveByteControlCodeToTag(i);
                        break;

                    case (byte)ControlCodeSizes.SixBytes:
                        ConvertSixByteControlCodeToTag(i);
                        break;

                    case (byte)ControlCodeSizes.SevenBytes:
                        ConvertSevenByteControlCodeToTag(i);
                        break;
                }
            }
        }