Example #1
0
 public void SetInfo(Data.GenericInfo info)
 {
     this.info = info;
     Console.WriteLine("\n\t=> Error: \n\t=> "
                       + " " + info.SourceName
                       + " " + info.Date
                       + " " + info.SourceError
                       );
 }
Example #2
0
        private void StartUpdating()
        {
            Random random = new Random();

            Data.GenericInfo[] infoList = new Data.GenericInfo[]
            {
                new Data.GenericInfo()
                {
                    SourceName = "Weather", Date = DateTime.Now.ToString(), SourceError = "Unable to start service"
                },
                new Data.GenericInfo()
                {
                    SourceName = "Kodi", Date = DateTime.Now.ToString(), SourceError = "Unable to start service"
                },
                new Data.GenericInfo()
                {
                    SourceName = "Generic Info", Date = DateTime.Now.ToString(), SourceError = "Service not available"
                },
                new Data.GenericInfo()
                {
                    SourceName = "Weather", Date = DateTime.Now.ToString(), SourceError = "Unable to start service"
                },
                new Data.GenericInfo()
                {
                    SourceName = "Weather", Date = DateTime.Now.ToString(), SourceError = "Unable to start service"
                },
                new Data.GenericInfo()
                {
                    SourceName = "Weather", Date = DateTime.Now.ToString(), SourceError = "Unable to start service"
                }
            };

            while (true)
            {
                SetInfo(infoList[random.Next(0, 5)]);
                Thread.Sleep(20000);
            }
            ;
        }
Example #3
0
 public void SetInfo(string SourceName, GenericInfo.Data.GenericInfo info)
 {
     GenericInfoObject.Find(SourceName).SetInfo(info);
 }