Beispiel #1
0
        void RichTextLightLine(RichTextBox richText, int lineNum)
        {
            int startIndex = GetStartIndex(richText, lineNum);

            LineText.Select(startIndex, richText.Lines[lineNum].Length);
            LineText.SelectionColor = valueColor;
        }
Beispiel #2
0
        public void LightCurrentLine()
        {
            int curCodeIndex = InterpretController.Instance.curCodeIndex;

            if (curCodeIndex != 0)
            {
                if (!needRecord)
                {
                    CodeText.Select(0, CodeText.Text.Length);
                    CodeText.SelectionColor = Color.Black;

                    LineText.Select(0, LineText.Text.Length);
                    LineText.SelectionColor = Color.Black;
                }
                List <Instruction> codeList = InterpretController.Instance.codeList;
                int startIndex = GetStartIndex(CodeText, curCodeIndex);
                CodeText.Select(startIndex, CodeText.Lines[curCodeIndex].Length);
                CodeText.SelectionColor = Color.Red;

                int lineIndex = CompileController.Instance.GetInstuctionLineIndex(curCodeIndex);
                startIndex = GetStartIndex(LineText, lineIndex);
                LineText.Select(startIndex, LineText.Lines[lineIndex].Length);
                LineText.SelectionColor = Color.Red;
            }
        }