PageRenderTime 24ms CodeModel.GetById 15ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/NRefactory/ICSharpCode.NRefactory.VB/Ast/GlobalScope/EnumMemberDeclaration.cs

http://github.com/icsharpcode/ILSpy
C# | 39 lines | 31 code | 6 blank | 2 comment | 0 complexity | 2f783e19e8df80ed1fb56ee7d74d771a MD5 | raw file
 1// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 2// This code is distributed under MIT X11 license (for details please see \doc\license.txt)
 3
 4using System;
 5using System.Collections.Generic;
 6using System.Linq;
 7
 8namespace ICSharpCode.NRefactory.VB.Ast
 9{
10	public class EnumMemberDeclaration : AstNode
11	{
12		public AstNodeCollection<AttributeBlock> Attributes {
13			get { return GetChildrenByRole(AttributeBlock.AttributeBlockRole); }
14		}
15		
16		public Identifier Name {
17			get { return GetChildByRole(Roles.Identifier); }
18			set { SetChildByRole(Roles.Identifier, value); }
19		}
20		
21		public Expression Value {
22			get { return GetChildByRole(Roles.Expression); }
23			set { SetChildByRole(Roles.Expression, value); }
24		}
25		
26		protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
27		{
28			var member = other as EnumMemberDeclaration;
29			return Attributes.DoMatch(member.Attributes, match) &&
30				Name.DoMatch(member.Name, match) &&
31				Value.DoMatch(member.Value, match);
32		}
33		
34		public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
35		{
36			return visitor.VisitEnumMemberDeclaration(this, data);
37		}
38	}
39}