Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="CSharpProcedureType"/> class.
        /// </summary>
        /// <param name="context">The creation context.</param>
        /// <param name="source">The Easly type from which the C# type is created.</param>
        /// <param name="originatingTypedef">The typedef where this type is declared.</param>
        protected CSharpProcedureType(ICSharpContext context, IProcedureType source, ICSharpTypedef originatingTypedef)
            : base(context, source, originatingTypedef)
        {
            Debug.Assert(source.OverloadList.Count > 0);

            ICSharpClass Owner = context.GetClass(source.EmbeddingClass);

            BaseType = Create(context, source.ResolvedBaseType.Item) as ICSharpTypeWithFeature;
            Debug.Assert(BaseType != null);

            foreach (ICommandOverloadType OverloadType in source.OverloadList)
            {
                ICSharpCommandOverloadType NewOverloadType = CSharpCommandOverloadType.Create(context, OverloadType, Owner);
                OverloadTypeList.Add(NewOverloadType);
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="CSharpFunctionType"/> class.
        /// </summary>
        /// <param name="context">The creation context.</param>
        /// <param name="source">The Easly type from which the C# type is created.</param>
        protected CSharpFunctionType(ICSharpContext context, IFunctionType source)
            : base(context, source)
        {
            Debug.Assert(source.OverloadList.Count > 0);

            ICSharpClass Owner = source.EmbeddingClass != null?context.GetClass(source.EmbeddingClass) : null;

            BaseType = Create(context, source.ResolvedBaseType.Item) as ICSharpTypeWithFeature;
            Debug.Assert(BaseType != null);

            foreach (IQueryOverloadType OverloadType in source.OverloadList)
            {
                ICSharpQueryOverloadType NewOverloadType = CSharpQueryOverloadType.Create(context, OverloadType, Owner);
                OverloadTypeList.Add(NewOverloadType);
            }
        }