Exemplo n.º 1
0
        async void GetSchedule()
        {
            try
            {
                // Get the schedule asychronously
                osVodigiWS.osVodigiServiceSoapClient ws = new osVodigiWS.osVodigiServiceSoapClient();
                ws.Endpoint.Address = new System.ServiceModel.EndpointAddress(new Uri(PlayerConfiguration.configVodigiWebserviceURL));

                osVodigiWS.Player_GetCurrentScheduleResponse scheduleResponse = await ws.Player_GetCurrentScheduleAsync(PlayerConfiguration.configPlayerID);

                string xml = scheduleResponse.Body.Player_GetCurrentScheduleResult;

                if (xml.StartsWith("<xml><Error>"))
                {
                    throw new Exception("Error");
                }

                ScheduleFile.SaveScheduleFile(xml);

                CurrentSchedule.ClearSchedule();
                CurrentSchedule.LastScheduleXML = xml;
                CurrentSchedule.ParseScheduleXml(xml); // Also copies the PlayerSettings to Helpers.PlayerSettings

                // At this point, the schedule has been retrieved, so go to the Download control
                FadeOut();
            }
            catch
            {
                DisplayErrorCondition();
            }
        }