private PlaceholderListItem NoProgramPlaceholder(IChannel channel, DateTime?startTime, DateTime?endTime)
        {
            ILocalization     loc                = ServiceRegistration.Get <ILocalization>();
            DateTime          today              = GuideStartTime.GetDay();
            ProgramProperties programProperties  = new ProgramProperties();
            Program           placeholderProgram = new Program
            {
                ProgramId = -1,
                ChannelId = channel.ChannelId,
                Title     = loc.ToString("[SlimTvClient.NoProgram]"),
                StartTime = startTime ?? today,
                EndTime   = endTime ?? today.AddDays(1)
            };

            programProperties.SetProgram(placeholderProgram, channel);

            var item = new PlaceholderListItem(programProperties)
            {
                Command = new MethodDelegateCommand(() => ShowProgramActions(placeholderProgram))
            };

            item.AdditionalProperties["PROGRAM"] = placeholderProgram;

            return(item);
        }
示例#2
0
        public void Add(PlaceholderModel[] models)
        {
            foreach (PlaceholderModel model in models.OrderBy(x => x.Name)) // TODO sort sur la liste car là ça ne marcherait pas pour plusieurs ajouts consécutifs
            {
                PlaceholderListItem item = new PlaceholderListItem()
                {
                    Content = model.Name,
                    Tag     = model.Id,
                };

                list.Items.Add(item);
                items.Add(model.Id, item);

                SetValidationResult(model, model.ValidationResult);
                item.ToolTip = validations[model.Id].Description == "" ? null : validations[model.Id].Description;
            }
        }
        private PlaceholderListItem NoProgramPlaceholder(IChannel channel, DateTime?startTime, DateTime?endTime)
        {
            ILocalization     loc                = ServiceRegistration.Get <ILocalization>();
            DateTime          today              = FormatHelper.GetDay(DateTime.Now);
            ProgramProperties programProperties  = new ProgramProperties(GuideStartTime, GuideEndTime);
            Program           placeholderProgram = new Program
            {
                ChannelId = channel.ChannelId,
                Title     = loc.ToString("[SlimTvClient.NoProgram]"),
                StartTime = startTime.HasValue ? startTime.Value : today,
                EndTime   = endTime.HasValue? endTime.Value : today.AddDays(1)
            };

            programProperties.SetProgram(placeholderProgram);

            var item = new PlaceholderListItem(programProperties);

            item.AdditionalProperties["PROGRAM"] = placeholderProgram;

            return(item);
        }