예제 #1
0
        public static car Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            car _car = new car();

            _car.m_rocrailClient = rocrailClient;
            _car.m_addr          = (int?)xml.Attribute("addr");
            _car.m_bus           = (int?)xml.Attribute("bus");
            _car.m_cmd           = (string)xml.Attribute("cmd");
            _car.m_color         = (string)xml.Attribute("color");
            _car.m_commuter      = (bool?)xml.Attribute("commuter");
            _car.m_decfile       = (string)xml.Attribute("decfile");
            _car.m_era           = (int?)xml.Attribute("era");
            _car.m_f0vcmd        = (bool?)xml.Attribute("f0vcmd");
            _car.m_fnlights      = (int?)xml.Attribute("fnlights");
            _car.m_id            = (string)xml.Attribute("id");
            _car.m_ident         = (string)xml.Attribute("ident");
            _car.m_iid           = (string)xml.Attribute("iid");
            _car.m_image         = (string)xml.Attribute("image");
            _car.m_invdir        = (bool?)xml.Attribute("invdir");
            _car.m_len           = (int?)xml.Attribute("len");
            _car.m_location      = (string)xml.Attribute("location");
            _car.m_manuid        = (string)xml.Attribute("manuid");
            _car.m_number        = (string)xml.Attribute("number");
            _car.m_owner         = (string)xml.Attribute("owner");
            _car.m_placing       = (bool?)xml.Attribute("placing");
            _car.m_prot          = (string)xml.Attribute("prot");
            _car.m_protver       = (int?)xml.Attribute("protver");
            _car.m_remark        = (string)xml.Attribute("remark");
            _car.m_roadname      = (string)xml.Attribute("roadname");
            _car.m_show          = (bool?)xml.Attribute("show");
            _car.m_status        = (string)xml.Attribute("status");
            _car.m_subtype       = (string)xml.Attribute("subtype");
            _car.m_type          = (string)xml.Attribute("type");
            _car.m_usedir        = (bool?)xml.Attribute("usedir");
            _car.m_uselights     = (bool?)xml.Attribute("uselights");
            _car.m_waybills      = (string)xml.Attribute("waybills");
            _car.m_weight_empty  = (int?)xml.Attribute("weight_empty");
            _car.m_weight_loaded = (int?)xml.Attribute("weight_loaded");
            Definitions.Tools.ParseList <cvbyte>(_car.m_cvbytelist, xml, "cvbyte", cvbyte.Parse, rocrailClient);
            Definitions.Tools.ParseList <fundef>(_car.m_fundeflist, xml, "fundef", fundef.Parse, rocrailClient);
            return(_car);
        }
예제 #2
0
 public void Update(car element)
 {
     if (element.m_addr.HasValue == true)
     {
         this.addr = element.addr;
     }
     if (element.m_bus.HasValue == true)
     {
         this.bus = element.bus;
     }
     if (element.m_cmd != null)
     {
         this.cmd = element.cmd;
     }
     if (element.m_color != null)
     {
         this.color = element.color;
     }
     if (element.m_commuter.HasValue == true)
     {
         this.commuter = element.commuter;
     }
     if (element.m_decfile != null)
     {
         this.decfile = element.decfile;
     }
     if (element.m_era.HasValue == true)
     {
         this.era = element.era;
     }
     if (element.m_f0vcmd.HasValue == true)
     {
         this.f0vcmd = element.f0vcmd;
     }
     if (element.m_fnlights.HasValue == true)
     {
         this.fnlights = element.fnlights;
     }
     if (element.m_id != null)
     {
         this.id = element.id;
     }
     if (element.m_ident != null)
     {
         this.ident = element.ident;
     }
     if (element.m_iid != null)
     {
         this.iid = element.iid;
     }
     if (element.m_image != null)
     {
         this.image = element.image;
     }
     if (element.m_invdir.HasValue == true)
     {
         this.invdir = element.invdir;
     }
     if (element.m_len.HasValue == true)
     {
         this.len = element.len;
     }
     if (element.m_location != null)
     {
         this.location = element.location;
     }
     if (element.m_manuid != null)
     {
         this.manuid = element.manuid;
     }
     if (element.m_number != null)
     {
         this.number = element.number;
     }
     if (element.m_owner != null)
     {
         this.owner = element.owner;
     }
     if (element.m_placing.HasValue == true)
     {
         this.placing = element.placing;
     }
     if (element.m_prot != null)
     {
         this.prot = element.prot;
     }
     if (element.m_protver.HasValue == true)
     {
         this.protver = element.protver;
     }
     if (element.m_remark != null)
     {
         this.remark = element.remark;
     }
     if (element.m_roadname != null)
     {
         this.roadname = element.roadname;
     }
     if (element.m_show.HasValue == true)
     {
         this.show = element.show;
     }
     if (element.m_status != null)
     {
         this.status = element.status;
     }
     if (element.m_subtype != null)
     {
         this.subtype = element.subtype;
     }
     if (element.m_type != null)
     {
         this.type = element.type;
     }
     if (element.m_usedir.HasValue == true)
     {
         this.usedir = element.usedir;
     }
     if (element.m_uselights.HasValue == true)
     {
         this.uselights = element.uselights;
     }
     if (element.m_waybills != null)
     {
         this.waybills = element.waybills;
     }
     if (element.m_weight_empty.HasValue == true)
     {
         this.weight_empty = element.weight_empty;
     }
     if (element.m_weight_loaded.HasValue == true)
     {
         this.weight_loaded = element.weight_loaded;
     }
     this.cvbytelist = element.cvbytelist;
     this.fundeflist = element.fundeflist;
 }