/// <summary> /// Initializes a new instance of the <see cref="CSharpInspectInstruction"/> class. /// </summary> /// <param name="context">The creation context.</param> /// <param name="parentFeature">The parent feature.</param> /// <param name="source">The Easly instruction from which the C# instruction is created.</param> protected CSharpInspectInstruction(ICSharpContext context, ICSharpFeature parentFeature, IInspectInstruction source) : base(context, parentFeature, source) { SourceExpression = CSharpExpression.Create(context, (IExpression)source.Source); foreach (IWith With in source.WithList) { ICSharpWith NewWith = CSharpWith.Create(context, parentFeature, With); WithList.Add(NewWith); } if (source.ElseInstructions.IsAssigned) { ElseInstructions = CSharpScope.Create(context, parentFeature, (IScope)source.ElseInstructions.Item); } }
/// <summary> /// Creates a new C# instruction. /// </summary> /// <param name="context">The creation context.</param> /// <param name="parentFeature">The parent feature.</param> /// <param name="source">The Easly instruction from which the C# instruction is created.</param> public static ICSharpInspectInstruction Create(ICSharpContext context, ICSharpFeature parentFeature, IInspectInstruction source) { return(new CSharpInspectInstruction(context, parentFeature, source)); }