/// <summary> /// Initializes a new instance of the <see cref="CSharpQualifiedName"/> 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="feature">The feature at the end of the path. Can be null.</param> /// <param name="discrete">The discrete at the end of the path. Can be null.</param> /// <param name="inheritBySideAttribute">Inherit the side-by-side attribute.</param> protected CSharpQualifiedName(ICSharpContext context, IQualifiedName source, ICSharpFeature feature, ICSharpDiscrete discrete, bool inheritBySideAttribute) : base(source) { Debug.Assert((feature != null && discrete == null) || (feature == null && discrete != null)); Feature = feature; Discrete = discrete; InheritBySideAttribute = inheritBySideAttribute; IsAttributeWithContract = feature is ICSharpAttributeFeature AsAttributeFeature && AsAttributeFeature.Source.EnsureList.Count > 0; foreach (IExpressionType Item in source.ValidResultTypePath.Item) { ICSharpClass ItemClass; if (Item.ValueType is IClassType AsClassType) { ItemClass = context.GetClass(AsClassType.BaseClass); } else { ItemClass = null; } ClassPath.Add(ItemClass); } }
/// <summary> /// Create a new C# qualified name. /// </summary> /// <param name="context">The creation context.</param> /// <param name="source">The Easly node from which the C# node is created.</param> /// <param name="feature">The feature at the end of the path. Can be null.</param> /// <param name="discrete">The discrete at the end of the path. Can be null.</param> /// <param name="inheritBySideAttribute">Inherit the side-by-side attribute.</param> public static ICSharpQualifiedName Create(ICSharpContext context, IQualifiedName source, ICSharpFeature feature, ICSharpDiscrete discrete, bool inheritBySideAttribute) { return(new CSharpQualifiedName(context, source, feature, discrete, inheritBySideAttribute)); }