private void UpdateChannelStatesForUsers()
    {
      TvBusinessLayer layer = new TvBusinessLayer();

      //System.Diagnostics.Debugger.Launch();
      // this section makes sure that all users are updated in regards to channel states.      
      ChannelStates channelStates = new ChannelStates(layer, this);

      if (channelStates != null)
      {
        IList<ChannelGroup> groups = ChannelGroup.ListAll();

        // populating _tvChannelListGroups is only done once as is therefor cached.
        if (_tvChannelListGroups == null)
        {
          foreach (ChannelGroup group in groups)
          {
            // we will only update user created groups, since it will often have fewer channels than "all channels"
            // going into "all channels" group in mini EPG will always be slower.
            if (group.GroupName.Equals(TvConstants.TvGroupNames.AllChannels))
              continue;

            if (_tvChannelListGroups == null)
            {
              _tvChannelListGroups = layer.GetTVGuideChannelsForGroup(group.IdGroup);
            }
            else
            {
              IList<Channel> tvChannelList = layer.GetTVGuideChannelsForGroup(group.IdGroup);

              foreach (Channel ch in tvChannelList)
              {
                bool exists = _tvChannelListGroups.Exists(delegate(Channel c) { return c.IdChannel == ch.IdChannel; });
                if (!exists)
                {
                  _tvChannelListGroups.Add(ch);
                }
              }
            }
          }
        }

        channelStates.SetChannelStates(_cards, _tvChannelListGroups, true, this);
      }
    }
    /// <summary>
    /// Fetches all channel states for a specific group
    /// </summary>
    /// <param name="idGroup"></param>    
    /// <param name="user"></param>        
    public Dictionary<int, ChannelState> GetAllChannelStatesForGroup(int idGroup, IUser user)
    {
      if (idGroup < 1)
      {
        return null;
      }

      if (user == null)
      {
        return null;
      }

      TvBusinessLayer layer = new TvBusinessLayer();
      IList<Channel> tvChannelList = layer.GetTVGuideChannelsForGroup(idGroup);

      if (tvChannelList == null || tvChannelList.Count == 0)
        return null;

      Dictionary<int, ChannelState> channelStatesList = new Dictionary<int, ChannelState>();
      ChannelStates channelStates = new ChannelStates(layer, this);

      if (channelStates != null)
      {
        channelStatesList = channelStates.GetChannelStates(_cards, tvChannelList, ref user, true, this);
      }

      return channelStatesList;
    }