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)
5
using System.Runtime.InteropServices;
7
namespace ICSharpCode.NRefactory.VB.Ast
9
public class ExternalMethodDeclaration : MemberDeclaration
11
public ExternalMethodDeclaration()
15
public CharsetModifier CharsetModifier { get; set; }
17
public bool IsSub { get; set; }
19
public Identifier Name {
20
get { return GetChildByRole(Roles.Identifier); }
21
set { SetChildByRole(Roles.Identifier, value); }
24
public string Library { get; set; }
26
public string Alias { get; set; }
28
public AstNodeCollection<ParameterDeclaration> Parameters {
29
get { return GetChildrenByRole(Roles.Parameter); }
32
public AstNodeCollection<AttributeBlock> ReturnTypeAttributes {
33
get { return GetChildrenByRole(AttributeBlock.ReturnTypeAttributeBlockRole); }
36
public AstType ReturnType {
37
get { return GetChildByRole(Roles.Type); }
38
set { SetChildByRole(Roles.Type, value); }
41
protected internal override bool DoMatch(AstNode other, ICSharpCode.NRefactory.PatternMatching.Match match)
44
var method = other as ExternalMethodDeclaration;
45
return method != null &&
46
MatchAttributesAndModifiers(method, match) &&
47
IsSub == method.IsSub &&
48
Name.DoMatch(method.Name, match) &&
49
Parameters.DoMatch(method.Parameters, match) &&
50
ReturnTypeAttributes.DoMatch(method.ReturnTypeAttributes, match) &&
51
ReturnType.DoMatch(method.ReturnType, match);
54
public override S AcceptVisitor<T, S>(IAstVisitor<T, S> visitor, T data)
56
return visitor.VisitExternalMethodDeclaration(this, data);
61
/// Charset types, used in external methods
62
/// declarations (VB only).
64
public enum CharsetModifier