示例#1
0
        private void ParseMetaProperty(StreamReader reader, string line, MetaObject dbo, MetaPropertyPurpose purpose)
        {
            string[] lines      = line.Split(',');
            string   fileName   = lines[2].Replace("}", string.Empty);
            string   objectName = lines[3].Replace("\"", string.Empty);

            MetaProperty property = new MetaProperty
            {
                Parent  = dbo,
                Name    = objectName,
                Purpose = purpose
            };

            dbo.Properties.Add(property);

            if (DBNames.TryGetValue(fileName, out DBNameEntry entry))
            {
                if (entry.DBNames.Count == 1)
                {
                    property.DbName = CreateMetaFieldName(entry.DBNames[0]);
                }
                else if (entry.DBNames.Count > 1)
                {
                    foreach (var dbn in entry.DBNames.Where(dbn => dbn.Token == DBToken.Fld))
                    {
                        property.DbName = CreateMetaFieldName(dbn);
                    }
                }
            }
            ParseMetaPropertyTypes(reader, property);
        }
示例#2
0
        private void ParseMetaProperties(StreamReader reader, string line, MetaObject dbo, MetaPropertyPurpose purpose)
        {
            string[] lines = line.Split(',');
            int      count = int.Parse(lines[1].Replace("}", string.Empty));
            Match    match;
            string   nextLine;

            for (int i = 0; i < count; i++)
            {
                while ((nextLine = reader.ReadLine()) != null)
                {
                    match = rxDbName.Match(nextLine);
                    if (match.Success)
                    {
                        ParseMetaProperty(reader, nextLine, dbo, purpose);
                        break;
                    }
                }
            }
        }