Boo.Lang.Compiler.TypeSystem.ExternalType.GetInterfaceDepth C# (CSharp) Method

GetInterfaceDepth() static private method

static private GetInterfaceDepth ( Type type ) : int
type System.Type
return int
        static int GetInterfaceDepth(Type type)
        {
            Type[] interfaces = type.GetInterfaces();
            if (interfaces.Length > 0)
            {
                int current = 0;
                foreach (Type i in interfaces)
                {
                    int depth = GetInterfaceDepth(i);
                    if (depth > current)
                    {
                        current = depth;
                    }
                }
                return 1+current;
            }
            return 1;
        }