コード例 #1
0
ファイル: StatementParent.cs プロジェクト: jdt/calidus
        // 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);
        }
コード例 #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);
        }
コード例 #3
0
ファイル: StatementParent.cs プロジェクト: jdt/calidus
 /// <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)
 {
 }
コード例 #4
0
ファイル: StatementParent.cs プロジェクト: jdt/calidus
 /// <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;
 }