Ejemplo n.º 1
0
        public void AddService(RiotSharp.StatusEndpoint.Service svc)
        {
            if (svc.Incidents.Count == 0)
            {
                svc.Status = char.ToUpper(svc.Status[0]) + svc.Status.Remove(0, 1);
            }
            else
            {
                svc.Status = char.ToUpper(svc.Status[0]) + svc.Status.Remove(0, 1) + " with some incidents";
            }
            switch (svc.Slug)
            {
            case "game":
                gamebx.SubTitle = svc.Status;
                gamesvc         = svc;
                break;

            case "web":
                webbx.SubTitle = svc.Status;
                wbsvc          = svc;
                break;

            case "store":
                storebx.SubTitle = svc.Status;
                storesvc         = svc;
                break;

            case "forums":
            case "boards":
                forumbx.SubTitle = svc.Status;
                boardsvc         = svc;
                break;
            }
        }
Ejemplo n.º 2
0
        string GetStatus(RiotSharp.StatusEndpoint.Service svc)
        {
            if (svc == null)
            {
                return("Service unavailable");
            }
            StringBuilder sbstat = new StringBuilder();

            if (svc.Incidents.Count > 0)
            {
                sbstat.AppendLine("      Incidents :");
                foreach (RiotSharp.StatusEndpoint.Incident incd in svc.Incidents)
                {
                    if (incd.Active)
                    {
                        foreach (RiotSharp.StatusEndpoint.Message upd in incd.Updates)
                        {
                            sbstat.AppendLine("          " + upd.Author + " - " + upd.CreatedAt.ToString());
                            sbstat.AppendLine("              [" + upd.Severity.ToUpper() + "] " + upd.Content);
                        }
                    }
                }
            }
            else
            {
                sbstat.AppendLine("No incident");
            }

            return(sbstat.ToString());
        }