Exemple #1
0
        internal static IEnumerable <ICustomAttribute> GetConstructorAttributes(this SourceConstructorSymbol ctor, IEnumerable <ICustomAttribute> attribs)
        {
            if (!ctor.IsGeneratedConstructor())
            {
                return(attribs);
            }
            var list = new List <ICustomAttribute>();

            foreach (var att in attribs)
            {
                if (!att.ToString().Contains(OurTypeNames.ClipperCallingConventionAttribute))
                {
                    list.Add(att);
                }
            }
            if (ctor.ParameterCount != 0)
            {
                var baseCtor = ctor.BaseConstructor() as MethodSymbol;
                if (baseCtor != null)
                {
                    foreach (var att in baseCtor.GetAttributes())
                    {
                        if (att.ToString().Contains("Clipper"))
                        {
                            list.Add(att);
                        }
                    }
                }
            }
            return(list);
        }
Exemple #2
0
        internal static MethodSymbol BaseConstructor(this SourceConstructorSymbol ctor)
        {
            var container = ctor.ContainingSymbol as SourceMemberContainerTypeSymbol;

            return(container.BaseConstructor());
        }