Exemplo n.º 1
0
        // override object.Equals
        public override bool Equals(object obj)
        {
            //
            // See the full list of guidelines at
            //   http://go.microsoft.com/fwlink/?LinkID=85237
            // and also the guidance for operator== at
            //   http://go.microsoft.com/fwlink/?LinkId=85238
            //

            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            StatementParent parent = (StatementParent)obj;

            if (Statements.SequenceEqual(parent.Statements) == false)
            {
                return(false);
            }
            if (StatementBase.Equals(Delimiter, parent.Delimiter) == false)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 2
0
        // override object.Equals
        public override bool Equals(object obj)
        {
            //
            // See the full list of guidelines at
            //   http://go.microsoft.com/fwlink/?LinkID=85237
            // and also the guidance for operator== at
            //   http://go.microsoft.com/fwlink/?LinkId=85238
            //

            if (obj == null || GetType() != obj.GetType())
            {
                return(false);
            }

            StatementBase theStatement = (StatementBase)obj;

            if (theStatement.Tokens.SequenceEqual(Tokens) == false)
            {
                return(false);
            }
            if (theStatement.Context.Equals(Context) == false)
            {
                return(false);
            }
            return(true);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Create a new instance of this class
 /// </summary>
 /// <param name="statement">The statement</param>
 /// <param name="delimiter">The delimiter</param>
 public StatementParent(StatementBase statement, StatementBase delimiter)
     : this(new[] { statement }, delimiter)
 {
 }
Exemplo n.º 4
0
 /// <summary>
 /// Create a new instance of this class
 /// </summary>
 /// <param name="statements">The statements</param>
 /// <param name="delimiter">The delimiter</param>
 public StatementParent(IEnumerable <StatementBase> statements, StatementBase delimiter)
 {
     Statements = statements;
     Delimiter  = delimiter;
 }