Exemplo n.º 1
0
        static DocFunction BuildFunction(DocItemContainer ic, Tuple <XElement, GacMethod> method)
        {
            DocFunction docFunction = new DocFunction();

            FillFunction(docFunction, method);
            ic.AddFunction(docFunction);
            return(docFunction);
        }
Exemplo n.º 2
0
        static DocField BuildField(DocItemContainer ic, Tuple <XElement, GacField> field)
        {
            DocField docField = new DocField();

            FillField(docField, field);
            ic.AddField(docField);
            return(docField);
        }
Exemplo n.º 3
0
        public DocType GetType(GacUDT udt, Dictionary <string, GacUDT> udts)
        {
            DocType resultType = null;

            if (!this.typeCache.TryGetValue(udt, out resultType))
            {
                CppName cppName      = CppName.Parse(udt.Name);
                var     cascadeNames = cppName
                                       .Cascade()
                                       .Select(c => new CppName()
                {
                    Name       = c.Name,
                    Parameters = c.Parameters,
                }.ToPdbString())
                                       .ToArray();

                string currentName    = "";
                int    namespaceCount = 0;
                for (int i = 0; i < cascadeNames.Length; i++)
                {
                    currentName += (i == 0 ? "" : "::") + cascadeNames[i];
                    if (udts.ContainsKey(currentName))
                    {
                        break;
                    }
                    namespaceCount = i + 1;
                }

                DocItemContainer ic = GetNamespace(cascadeNames.Take(namespaceCount));
                for (int i = namespaceCount; i < cascadeNames.Length; i++)
                {
                    ic = ic.GetType(cascadeNames[i]);
                }
                resultType     = (DocType)ic;
                resultType.Udt = udt;
                this.typeCache.Add(udt, resultType);
            }
            return(resultType);
        }