public void CopyFrom(ServicoInfo newInfo)
        {
            this.Estado = newInfo.Estado;
            this.NextCall = newInfo.NextCall;
            this.TimerInterval = newInfo.TimerInterval;
            this.ActionStart = newInfo.ActionStart;
            this.ActionEnd = newInfo.ActionEnd;

            this.Updated = DateTime.Now;
        }
 public void OnInfoChanged(ServicoInfo newInfo)
 {
     CopyFrom(newInfo);
 }
        public void Perform(ServicoInfo info)
        {
            HtmlDocument doc = GetPagina(this.URL.AbsoluteUri);

            if (doc.DocumentNode != null)
            {
                output = new XML();
                string filename = DateTime.Now.ToString("yyyyMMdd_HHmmss") + ".xml";

                HtmlNodeCollection tLista = doc.DocumentNode.SelectNodes(@"(//div[@id='done']//table//tr//a)"); //[position() < 3]

                if (tLista != null)
                {
                    this.NewMessage.Raise(Mensagem.MessageType.Info, "Found " + tLista.Count + " item(s)");

                    foreach (HtmlNode row in tLista)
                    {
                        info.ActionEnd = DateTime.Now; // Serve como indicador de progresso

                        HtmlAttribute attr = row.Attributes["href"];
                        if (attr != null)
                        {
                            string link = attr.Value;

                            GetFicha(link);
                        }

                        output.Save(filename);
                    }
                }

                this.NewMessage.Raise(Mensagem.MessageType.Info, "Saved : " + filename);
            }
        }