/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. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. namespace ICSharpCode.NRefactory.VB.Ast
  7. {
  8. public class EnumMemberDeclaration : AstNode
  9. {
  10. public AstNodeCollection<AttributeBlock> Attributes {
  11. get { return GetChildrenByRole(AttributeBlock.AttributeBlockRole); }
  12. }
  13. public Identifier Name {
  14. get { return GetChildByRole(Roles.Identifier); }
  15. set { SetChildByRole(Roles.Identifier, value); }
  16. }
  17. public Expression Value {
  18. get { return GetChildByRole(Roles.Expression); }
  19. set { SetChildByRole(Roles.Expression, value); }
  20. }
  21. protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
  22. {
  23. var member = other as EnumMemberDeclaration;
  24. return Attributes.DoMatch(member.Attributes, match) &&
  25. Name.DoMatch(member.Name, match) &&
  26. Value.DoMatch(member.Value, match);
  27. }
  28. public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
  29. {
  30. return visitor.VisitEnumMemberDeclaration(this, data);
  31. }
  32. }
  33. }