예제 #1
0
        private UPnPError OnGetProgramsGroup(DvAction action, IList <object> inParams, out IList <object> outParams, CallContext context)
        {
            outParams = new List <object>();
            IProgramInfoAsync programInfo = ServiceRegistration.Get <ITvProvider>() as IProgramInfoAsync;

            if (programInfo == null)
            {
                return(new UPnPError(500, "IProgramInfo service not available"));
            }

            int      channelGroupId = (int)inParams[0];
            DateTime timeFrom       = (DateTime)inParams[1];
            DateTime timeTo         = (DateTime)inParams[2];

            AsyncResult <IList <IProgram> > result = programInfo.GetProgramsGroupAsync(new ChannelGroup {
                ChannelGroupId = channelGroupId
            }, timeFrom, timeTo).Result;

            outParams = new List <object> {
                result.Success, result.Result
            };
            return(null);
        }