Beispiel #1
0
        //============================================================
        // <T>获取类。</T>
        // @parame strline 需要获取的字符串集合。
        // @param index 当前索引
        // @return 获取的类对象
        //============================================================
        public void ParserClass(FStrings strLine, FCsSpace space, int index, string path, FClassesIndexTable indextable, StreamWriter swPrint, FileInfo file, string relative)
        {
            FXmlDocument doc        = new FXmlDocument();
            FXmlNode     config     = doc.Root;
            FXmlNode     nodeSpace  = space.XMLMaker(config);
            FXmlNode     xmlClass   = XMLMaker(nodeSpace, indextable, swPrint, file, relative);
            FXmlNode     fields     = new FXmlNode("Fields");
            FXmlNode     properties = new FXmlNode("Properties");
            FXmlNode     methods    = new FXmlNode("Methods");

            MakeInterfaceNode(this.Interface, xmlClass, indextable);
            xmlClass.Push(fields);
            xmlClass.Push(properties);
            xmlClass.Push(methods);
            int start, end = CheckParaAnnotate(strLine, index, out start);

            for (int n = _startIndex; n < _endIndex; n++)
            {
                if (IsInInterregional(n, start, end))
                {
                    continue;
                }
                if (IsField(strLine[n]))
                {
                    FCsField field = new FCsField(strLine, n);
                    field.Parser(fields, indextable, swPrint, file, relative);
                }
                if (IsProperty(strLine[n]))
                {
                    FCsProperty property = new FCsProperty(strLine, n, GetPairNum(strLine, n));
                    property.ParserPorperty(properties, indextable, swPrint, file, relative);
                }
                if (IsMethod(strLine[n]))
                {
                    int       endIndex = GetPairNum(strLine, n);
                    FCsMethod method   = new FCsMethod();
                    method.FillValue(strLine, n, endIndex);
                    method.ParserMethod(strLine, n, methods, indextable, swPrint, file, relative);
                    this.Method.Add(method);
                }
                if (FCsSpace.IsClass(strLine[n + 1]))
                {
                    SaveSXMLFile(path, doc);
                    FillValue(strLine, n + 1, GetPairNum(strLine, n + 1));
                    ParserClass(strLine, space, n + 1, path, indextable, swPrint, file, relative);
                }
            }
            SaveSXMLFile(path, doc);
        }
Beispiel #2
0
 public bool IsFieldAnnotateFine(FCsField csField)
 {
     return(true);
 }