Exemplo n.º 1
0
 /// <summary>
 /// 读取table 中 key类型结点的内容
 /// 
 /// </summary>
 /// <param name="xnColumns">key结点</param>
 /// <param name="pTable">key结点 所属的table</param>
 private void ReadKeys(XmlNode xnKeys, TableInfo pTable)
 {
     foreach (XmlNode xnKey in xnKeys)
     {
         pTable.AddKey(GetKey(xnKey));
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 获取table类型结点的内容
        /// </summary>
        /// <param name="xnTable">table结点</param>
        /// <returns></returns>
        private TableInfo GetTable(XmlNode xnTable)
        {
            TableInfo mTable = new TableInfo();
            XmlElement xe = (XmlElement)xnTable;

            mTable.Id = xe.GetAttribute("Id");

            XmlNodeList xnTProperty = xe.ChildNodes;
            foreach (XmlNode xnP in xnTProperty)
            {
                /// <summary>
                /// 以下判断可能还不全面,例如还有c:PrimaryKey
                /// 需要根据实际的需要添加
                /// </summary>
                switch (xnP.Name)
                {
                    case "a:ObjectID": mTable.ObjectID = xnP.InnerText;
                        break;
                    case "a:Name": mTable.Name = xnP.InnerText;
                        break;
                    case "a:Code": mTable.Code = xnP.InnerText;
                        break;
                    case "a:CreationDate": mTable.CreationDate = xnP.InnerText;
                        break;
                    case "a:Creator": mTable.Creator = xnP.InnerText;
                        break;
                    case "a:ModificationDate": mTable.ModificationDate = xnP.InnerText;
                        break;
                    case "a:Modifier": mTable.Modifier = xnP.InnerText;
                        break;
                    case "a:Comment": mTable.Comment = xnP.InnerText;
                        break;
                    case "c:Columns": ReadColumns(xnP, mTable);
                        break;
                    case "c:Keys": ReadKeys(xnP, mTable);
                        break;
                }
            }
            return mTable;

        }
Exemplo n.º 3
0
 /// <summary>
 /// 读取table 中 column类型结点的内容
 ///         /// </summary>
 /// <param name="xnColumns">column结点</param>
 /// <param name="pTable">column结点 所属的table</param>
 private void ReadColumns(XmlNode xnColumns, TableInfo pTable)
 {
     foreach (XmlNode xnColumn in xnColumns)
     {
         pTable.AddColumn(GetColumn(xnColumn));
     }
 }