Esempio n. 1
0
        private void RenderCodeCut(IRenderer renderer, float x, float y, UCodeCut cut)
        {
            try
            {
                if (cut.CutType == UCutType.Space || cut.CutType == UCutType.NewLine)
                {
                    return;
                }

                renderer.DrawText(x, y, cut.Data, cut.CutType.CutColor);

                if (cut.CutType == UCutType.Error)
                {
                    renderer.DrawDash(
                        new UPoint((int)x, (int)(y + renderer.CharHeight)),
                        new UPoint((int)(x + UHelper.GetAbsoluteLength(cut.Data) * renderer.CharWidth),
                                   (int)(y + renderer.CharHeight)),
                        UColor.Red);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Esempio n. 2
0
        public void ParseCode()
        {
            mPrometStrings.Clear();

            mPrometStrings.AddRange(UConfig.KeyWords);

            int count = Coder.CodeManager.GetCodeCount();

            for (int i = 0; i < count; i++)
            {
                UCodeLine line = Coder.CodeManager.GetCodeLine(i);

                int cutCount = line.GetCutCount();

                for (int n = 0; n < cutCount; n++)
                {
                    UCodeCut cut = line.GetCutByIndex(n);

                    if (cut.CutType == UCutType.VariableName ||
                        cut.CutType == UCutType.ClassName ||
                        cut.CutType == UCutType.FunctionName)
                    {
                        if (!mPrometStrings.Contains(cut.Data))
                        {
                            mPrometStrings.Add(cut.Data);
                        }
                    }
                }
            }
        }
Esempio n. 3
0
        private void RenderCodeLine(IRenderer renderer, float x, float y, UCodeLine line)
        {
            try
            {
                float renderX = x;

                int count = line.GetCutCount();

                for (int i = 0; i < count; i++)
                {
                    UCodeCut cut = line.GetCutByIndex(i);

                    RenderCodeCut(renderer, renderX, y, cut);

                    renderX = renderX + UHelper.GetAbsoluteLength(cut.Data) * renderer.CharWidth;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }