/// <summary>
 /// 
 /// </summary>
 public CodeFieldInfo(BaseInfo parent, CodeElement item, TypeInfo type)
     : base(parent, item as CodeElement2)
 {
     this._item = item;
     this.Access = CMAccess.Public; // ObjectFactory.Convert(this._item.Access);
     this._type = type;
 }
 /// <summary>
 /// 
 /// </summary>
 public virtual CodeFieldInfo CreateEnumValue(EnumInfo parent, CodeElement item, TypeInfo type)
 {
     return new CodeFieldInfo(parent, item, type);
 }
 private void Add(TypeInfo t2)
 {
     this._list.Add(t2);
 }
        private void Parse(string type, TypeInfo t, ref int p)
        {
            System.Text.StringBuilder s = new System.Text.StringBuilder();
            for (int i = p; i < type.Length; i++)
            {

                deb:
                var c = type[i];
                switch (c)
                {

                    case '<':
                        i++;
                        p = i;
                        t.Name = s.ToString();
                        var t2 = new TypeInfo();
                        t.Add(t2);
                        Parse(type, t2, ref p);
                        i = p;

                        if (i < type.Length)
                        {

                            c = type[p];

                            if (c != ',')
                                goto deb;

                            while ((c = type[p]) == ',')
                            {
                                p++;
                                t2 = new TypeInfo();
                                t.Add(t2);
                                Parse(type, t2, ref p);
                                i = p;
                                if (i >= type.Length)
                                    return;
                            }

                            c = type[p];

                            if (c != ',')
                                goto deb;

                        }

                        return;

                    case '>':
                        p = i;
                        p++;
                        t.Name = s.ToString();
                        return;

                    case '[':
                        t.Name = s.ToString();
                        p = i;
                        t.ParseArray(type, ref p);
                        i = p;
                        break;

                    case ',':
                        t.Name = s.ToString();
                        p = i;
                        return;

                    case ' ':
                    case '\t':
                    case '\r':
                    case '\n':
                        break;

                    case '0':
                    case '1':
                    case '2':
                    case '3':
                    case '4':
                    case '5':
                    case '6':
                    case '7':
                    case '8':
                    case '9':
                    case 'a':
                    case 'b':
                    case 'c':
                    case 'd':
                    case 'e':
                    case 'f':
                    case 'g':
                    case 'h':
                    case 'i':
                    case 'j':
                    case 'k':
                    case 'l':
                    case 'm':
                    case 'n':
                    case 'o':
                    case 'p':
                    case 'q':
                    case 'r':
                    case 's':
                    case 't':
                    case 'u':
                    case 'v':
                    case 'w':
                    case 'x':
                    case 'y':
                    case 'z':
                    case 'A':
                    case 'B':
                    case 'C':
                    case 'D':
                    case 'E':
                    case 'F':
                    case 'G':
                    case 'H':
                    case 'I':
                    case 'J':
                    case 'K':
                    case 'L':
                    case 'M':
                    case 'N':
                    case 'O':
                    case 'P':
                    case 'Q':
                    case 'R':
                    case 'S':
                    case 'T':
                    case 'U':
                    case 'V':
                    case 'W':
                    case 'X':
                    case 'Y':
                    case 'Z':
                    case '.':
                    case '_':
                        s.Append(c);
                        break;

                    case '?':
                        t.IsNullable = true;
                        s.Append(c);
                        break;
                    default:
                        throw new FormatException(type);

                }

            }
        }
            /// <summary>
            /// return the class of the specified object 
            /// </summary>
            public IEnumerable<BaseInfo> ResolveType(TypeInfo type)
            {
                var t = type.Name;

                if (this.Indexeclasses.Contains(t))
                {

                    IEnumerable<KeyValuePair<string, BaseInfo>> results = this.Indexeclasses[t];

                    foreach (KeyValuePair<string, BaseInfo> k in results)
                        yield return k.Value;

                }

                yield break;
            }