public DeclaredVariables(string source,
                                 List <string> fullNamespaceList, bool visibleScopesOnly)
        {
            _declaredVariables = new List <Variable>();

            /*
             * Get the local variables declared in the source.
             */

            source = JScriptFormattingTools.RemoveNamespaceDeclarations(source);

            if (visibleScopesOnly)
            {
                source = JScriptFormattingTools.RemoveInaccessibleScopes(source);
            }

            FindVariableDeclaratons(source);

            /*
             * Convert the JScript typenames to their framework classes.
             */

            foreach (Variable v in _declaredVariables)
            {
                // Fixup any language type names
                v.Type = JScriptFormattingTools.ToCTSType(v.Type);
            }
        }
Exemple #2
0
        public string GetVariableCollectionType(string entity)
        {
            /*
             * For arrays we return the item that the object is a
             * collection of. For anything else we need to swap in
             * the base type and append 'Item'.
             */

            if (IsArray)
            {
                return(JScriptFormattingTools.ToCTSType(ArrayType));
            }
            else
            {
                string[] split = entity.Split('.');
                split[0] = Type;

                return(String.Join(".", split) + ".Item");
            }
        }