Exemplo n.º 1
0
        public static sc Parse(System.Xml.Linq.XElement xml, CRocrailClient rocrailClient)
        {
            sc _sc = new sc();

            _sc.m_rocrailClient  = rocrailClient;
            _sc.m_cycles         = (int?)xml.Attribute("cycles");
            _sc.m_fromhour       = (int?)xml.Attribute("fromhour");
            _sc.m_id             = (string)xml.Attribute("id");
            _sc.m_maxdelay       = (int?)xml.Attribute("maxdelay");
            _sc.m_scaction       = (string)xml.Attribute("scaction");
            _sc.m_timeframe      = (int?)xml.Attribute("timeframe");
            _sc.m_timeprocessing = (int?)xml.Attribute("timeprocessing");
            _sc.m_tohour         = (int?)xml.Attribute("tohour");
            _sc.m_type           = (string)xml.Attribute("type");
            Definitions.Tools.ParseList <actionctrl>(_sc.m_actionctrllist, xml, "actionctrl", actionctrl.Parse, rocrailClient);
            Definitions.Tools.ParseList <scentry>(_sc.m_scentrylist, xml, "scentry", scentry.Parse, rocrailClient);
            return(_sc);
        }
Exemplo n.º 2
0
 public void Update(sc element)
 {
     if (element.m_cycles.HasValue == true)
     {
         this.cycles = element.cycles;
     }
     if (element.m_fromhour.HasValue == true)
     {
         this.fromhour = element.fromhour;
     }
     if (element.m_id != null)
     {
         this.id = element.id;
     }
     if (element.m_maxdelay.HasValue == true)
     {
         this.maxdelay = element.maxdelay;
     }
     if (element.m_scaction != null)
     {
         this.scaction = element.scaction;
     }
     if (element.m_timeframe.HasValue == true)
     {
         this.timeframe = element.timeframe;
     }
     if (element.m_timeprocessing.HasValue == true)
     {
         this.timeprocessing = element.timeprocessing;
     }
     if (element.m_tohour.HasValue == true)
     {
         this.tohour = element.tohour;
     }
     if (element.m_type != null)
     {
         this.type = element.type;
     }
     this.actionctrllist = element.actionctrllist;
     this.scentrylist    = element.scentrylist;
 }