Exemplo n.º 1
0
        /// <remarks>
        /// Returns all (nestet) classes in which the carret currently is exept
        /// the innermost class, returns an empty collection if the carret is in 
        /// no class or only in the innermost class.
        /// the most outer class is the last in the collection.
        /// </remarks>
        ClassCollection GetOuterClasses()
        {
            ClassCollection classes = new ClassCollection();
            if (cu != null) {
                foreach (IClass c in cu.Classes) {
                    if (c != null && c.Region != null && c.Region.IsInside(caretLine, caretColumn)) {
                        if (c != GetInnermostClass()) {
                            GetOuterClasses(classes, c);
                            classes.Add(GetResolvedClass (c));
                        }
                        break;
                    }
                }
            }

            return classes;
        }
Exemplo n.º 2
0
 void GetOuterClasses(ClassCollection classes, IClass curClass)
 {
     if (curClass != null) {
         foreach (IClass c in curClass.InnerClasses) {
             if (c != null && c.Region != null && c.Region.IsInside(caretLine, caretColumn)) {
                 if (c != GetInnermostClass()) {
                     GetOuterClasses(classes, c);
                     classes.Add(GetResolvedClass (c));
                 }
                 break;
             }
         }
     }
 }
        public bool ResolveTypes(Project project, ICompilationUnit unit, ClassCollection types, out ClassCollection result)
        {
            CompilationUnitTypeResolver tr = new CompilationUnitTypeResolver (GetProjectDatabase (project), unit, this);

            bool allResolved = true;
            result = new ClassCollection ();
            foreach (IClass c in types) {
                tr.CallingClass = c;
                tr.AllResolved = true;
                result.Add (PersistentClass.Resolve (c, tr));
                allResolved = allResolved && tr.AllResolved;
            }

            return allResolved;
        }