TypeScriptUnresolvedTypeDefinition AddClass(NavigationBarItem item, IDocument document)
		{
			var defaultClass = new TypeScriptUnresolvedTypeDefinition(item.text) {
				UnresolvedFile = this
			};
			defaultClass.BodyRegion = item.ToRegionStartingFromOpeningCurlyBrace(document);
			defaultClass.Region = defaultClass.BodyRegion;
			
			TypeScriptUnresolvedTypeDefinition parentClass = FindParentClass(defaultClass);
			if (parentClass != null) {
				defaultClass.Namespace = parentClass.FullName;
				parentClass.NestedTypes.Add(defaultClass);
			} else {
				typeDefinitions.Add(defaultClass);
			}
			AddMethods(defaultClass, item.childItems, document);
			return defaultClass;
		}
		void UpdateMethodRegions(DefaultUnresolvedMethod method, NavigationBarItem item, IDocument document)
		{
			DomRegion region = item.ToRegionStartingFromOpeningCurlyBrace(document);
			method.Region = new DomRegion(
				region.BeginLine,
				region.BeginColumn,
				region.BeginLine,
				region.BeginColumn);
			method.BodyRegion = region;
		}
        DefaultClass AddClass(NavigationBarItem item, IDocument document)
        {
            var defaultClass = new DefaultClass(this, item.text);
            defaultClass.BodyRegion = item.ToRegionStartingFromOpeningCurlyBrace(document);
            defaultClass.Region = defaultClass.BodyRegion;

            IClass parentClass = FindParentClass(defaultClass);
            if (parentClass != null) {
                defaultClass.FullyQualifiedName = parentClass.FullyQualifiedName + "." + defaultClass.FullyQualifiedName;
                parentClass.InnerClasses.Add(defaultClass);
            } else {
                Classes.Add(defaultClass);
            }
            AddMethods(defaultClass, item.childItems, document);
            return defaultClass;
        }