public override INode Visit(IMethod source, IMethod data) { DomMethod result = CreateInstance(source, data); Visit(source, result, data); foreach (ITypeParameter tp in source.TypeParameters) { if (!typeTable.ContainsKey(tp.Name)) { result.AddTypeParameter(Visit(tp, data)); } } result.MethodModifier = source.MethodModifier; if (source.Parameters != null) { foreach (IParameter parameter in source.Parameters) { result.Add((IParameter)parameter.AcceptVisitor(this, data)); } } return(result); }
public static DomType CreateDelegate(ICompilationUnit compilationUnit, string name, DomLocation location, IReturnType type, IEnumerable <IParameter> parameters) { DomType result = new DomType(); result.compilationUnit = compilationUnit; result.Name = name; result.classType = MonoDevelop.Projects.Dom.ClassType.Delegate; DomMethod delegateMethod = new DomMethod("Invoke", Modifiers.None, MethodModifier.None, location, DomRegion.Empty, type); delegateMethod.Add(parameters); result.Add(delegateMethod); return(result); }
public virtual INode Visit(IMethod source, T data) { DomMethod result = CreateInstance(source, data); Visit(source, result, data); foreach (ITypeParameter tp in source.TypeParameters) { result.AddTypeParameter(Visit(tp, data)); } result.MethodModifier = source.MethodModifier; foreach (IParameter parameter in source.Parameters) { result.Add((IParameter)parameter.AcceptVisitor(this, data)); } return(result); }