示例#1
0
 public bool Equals(EForeach other)
 {
     return(StartPosition == other.StartPosition && EndPosition == other.EndPosition &&
            (Variable.Member != null && Variable.Member.Equals(other.Variable.Member) || Variable.Member == null && other.Variable.Member == null) &&
            Collection.Member.Equals(other.Collection.Member) &&
            BodyPosition == other.BodyPosition);
 }
示例#2
0
        public static EForeach GetExpression(ScintillaControl sci, int position)
        {
            var result        = new EForeach(-1, -1, null, null, -1);
            var startPosition = GetStartOfStatement(sci, position);

            if (startPosition != -1)
            {
                result.StartPosition = startPosition;
                result.EndPosition   = GetEndOfStatement(sci, position);
                result.Variable      = GetVarOfForeachStatement(sci, position);
                result.Collection    = GetCollectionOfForeachStatement(sci, position);
                result.BodyPosition  = GetStartOfBody(sci, position);
            }
            else
            {
                result.Variable   = new ASResult();
                result.Collection = new ASResult();
            }
            return(result);
        }