/// <summary> /// Initializes a new instance of the <see cref="CSharpCommandOverload"/> class. /// </summary> /// <param name="context">The creation context.</param> /// <param name="source">The Easly node from which the C# node is created.</param> /// <param name="parentFeature">The parent feature.</param> /// <param name="owner">The class where the overload is declared.</param> protected CSharpCommandOverload(ICSharpContext context, ICommandOverload source, ICSharpFeature parentFeature, ICSharpClass owner) : base(source) { ParentFeature = parentFeature; foreach (IParameter Parameter in source.ParameterTable) { ICSharpParameter NewParameter = CSharpParameter.Create(context, Parameter, owner); ParameterList.Add(NewParameter); } Body = CSharpBody.Create(context, parentFeature, source.ResolvedBody.Item); }
/// <summary> /// Initializes the feature overloads and bodies. /// </summary> /// <param name="context">The initialization context.</param> public override void InitOverloadsAndBodies(ICSharpContext context) { EntityType = CSharpType.Create(context, Source.ResolvedEntityType.Item); if (Source.GetterBody.IsAssigned) { GetterBody = CSharpBody.Create(context, this, (ICompiledBody)Source.GetterBody.Item); } if (Source.SetterBody.IsAssigned) { SetterBody = CSharpBody.Create(context, this, (ICompiledBody)Source.SetterBody.Item); } }
/// <summary> /// Initializes the feature overloads and bodies. /// </summary> /// <param name="context">The initialization context.</param> public override void InitOverloadsAndBodies(ICSharpContext context) { EntityType = CSharpType.Create(context, Source.ResolvedEntityType.Item); foreach (IParameter Parameter in Source.ParameterTable) { ICSharpParameter NewParameter = CSharpParameter.Create(context, Parameter, Owner); IndexParameterList.Add(NewParameter); } if (Source.GetterBody.IsAssigned) { GetterBody = CSharpBody.Create(context, this, (ICompiledBody)Source.GetterBody.Item); } if (Source.SetterBody.IsAssigned) { SetterBody = CSharpBody.Create(context, this, (ICompiledBody)Source.SetterBody.Item); } }