IronPython.Runtime.Types.NewTypeInfo.GetBaseTypeFromUserType C# (CSharp) Method

GetBaseTypeFromUserType() private static method

private static GetBaseTypeFromUserType ( IronPython.Runtime.Types.PythonType curBasePythonType, IList baseInterfaces, Type curTypeToExtend ) : Type
curBasePythonType IronPython.Runtime.Types.PythonType
baseInterfaces IList
curTypeToExtend System.Type
return System.Type
        private static Type GetBaseTypeFromUserType(PythonType curBasePythonType, IList<Type> baseInterfaces, Type curTypeToExtend) {
            Queue<PythonType> processing = new Queue<PythonType>();
            processing.Enqueue(curBasePythonType);

            do {
                PythonType walking = processing.Dequeue();
                foreach (PythonType dt in walking.BaseTypes) {
                    if (dt.ExtensionType == curTypeToExtend || curTypeToExtend.IsSubclassOf(dt.ExtensionType)) continue;

                    if (dt.ExtensionType.IsInterface) {
                        baseInterfaces.Add(dt.ExtensionType);
                    } else if (NewTypeMaker.IsInstanceType(dt.ExtensionType)) {
                        processing.Enqueue(dt);
                    } else if (!dt.IsOldClass) {
                        curTypeToExtend = null;
                        break;
                    }
                }
            } while (processing.Count > 0);
            return curTypeToExtend;
        }