Exemple #1
0
        private static MemberInfo [] FilterOverridenMembersOut(
            MemberInfo [] ml)
        {
            if (ml == null)
            {
                return(empty_member_infos);
            }

            ArrayList al = new ArrayList(ml.Length);

            for (int i = 0; i < ml.Length; i++)
            {
                MethodBase   mx = ml [i] as MethodBase;
                PropertyInfo px = ml [i] as PropertyInfo;
                if (mx != null || px != null)
                {
                    bool overriden = false;
                    for (int j = 0; j < ml.Length; j++)
                    {
                        if (j == i)
                        {
                            continue;
                        }
                        MethodBase my = ml [j] as MethodBase;
                        if (mx != null && my != null &&
                            MethodGroupExpr.IsOverride(my, mx))
                        {
                            overriden = true;
                            break;
                        }
                        else if (mx != null)
                        {
                            continue;
                        }
                        PropertyInfo py = ml [j] as PropertyInfo;
                        if (px != null && py != null &&
                            IsOverride(py, px))
                        {
                            overriden = true;
                            break;
                        }
                    }
                    if (overriden)
                    {
                        continue;
                    }
                }
                al.Add(ml [i]);
            }
            return(al.ToArray(typeof(MemberInfo)) as MemberInfo []);
        }