示例#1
0
        public void SetLineInfo(Plan plan, LineInfo lineInfo)
        {
            if (lineInfo != null)
            {
                if (_lineInfo == null)
                {
                    _lineInfo = new LineInfo();
                }

                if (plan.CompilingOffset != null)
                {
                    _lineInfo.Line       = lineInfo.Line - plan.CompilingOffset.Line;
                    _lineInfo.LinePos    = lineInfo.LinePos - ((plan.CompilingOffset.Line == lineInfo.Line) ? plan.CompilingOffset.LinePos : 0);
                    _lineInfo.EndLine    = lineInfo.EndLine - plan.CompilingOffset.Line;
                    _lineInfo.EndLinePos = lineInfo.EndLinePos - ((plan.CompilingOffset.Line == lineInfo.EndLine) ? plan.CompilingOffset.LinePos : 0);
                }
                else
                {
                    _lineInfo.SetFromLineInfo(lineInfo);
                }
            }
        }