コード例 #1
0
    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);

      var item = new PlaceholderListItem(programProperties)
      {
        Command = new MethodDelegateCommand(() => ShowProgramActions(placeholderProgram))
      };
      item.AdditionalProperties["PROGRAM"] = placeholderProgram;

      return item;
    }
コード例 #2
0
    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;
    }