示例#1
0
        public static tk Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            tk _tk = new tk();

            _tk.m_rocrailClient = rocrailClient;
            _tk.m_blockid       = (string)xml.Attribute("blockid");
            _tk.m_counterpartid = (string)xml.Attribute("counterpartid");
            _tk.m_desc          = (string)xml.Attribute("desc");
            _tk.m_id            = (string)xml.Attribute("id");
            _tk.m_ori           = (string)xml.Attribute("ori");
            _tk.m_tknr          = (int?)xml.Attribute("tknr");
            _tk.m_type          = (string)xml.Attribute("type");
            _tk.m_x             = (int?)xml.Attribute("x");
            _tk.m_y             = (int?)xml.Attribute("y");
            _tk.m_z             = (int?)xml.Attribute("z");
            return(_tk);
        }
示例#2
0
 public void Update(tk element)
 {
     if (element.m_blockid != null)
     {
         this.blockid = element.blockid;
     }
     if (element.m_counterpartid != null)
     {
         this.counterpartid = element.counterpartid;
     }
     if (element.m_desc != null)
     {
         this.desc = element.desc;
     }
     if (element.m_id != null)
     {
         this.id = element.id;
     }
     if (element.m_ori != null)
     {
         this.ori = element.ori;
     }
     if (element.m_tknr.HasValue == true)
     {
         this.tknr = element.tknr;
     }
     if (element.m_type != null)
     {
         this.type = element.type;
     }
     if (element.m_x.HasValue == true)
     {
         this.x = element.x;
     }
     if (element.m_y.HasValue == true)
     {
         this.y = element.y;
     }
     if (element.m_z.HasValue == true)
     {
         this.z = element.z;
     }
 }