/// <summary> /// /// </summary> /// <param name="item"></param> /// <returns></returns> public bool Contain(ProgramScreen item) { for (int i = 0; i < this.Count; i++) { if (this[i] == item) { return(true); } } return(false); }
/// <summary> /// /// </summary> /// <param name="item"></param> /// <exception cref="ArgumentNullException"><c>item</c> is null.</exception> /// <exception cref="ArgumentException"><c>ArgumentException</c>.</exception> public void Add(ProgramScreen item) { if (item == null) { throw new ArgumentNullException("item"); } if (m_programScreenList.FoundKey(item.DatabaseScreenData.ScreenCD.StrongValue)) { throw new ArgumentException(String.Format("Key: \"{0}\" has already exists.", item.DatabaseScreenData.ImageCD.StrongValue)); } this.m_programScreenList.Put(item.DatabaseScreenData.ScreenCD.StrongValue, item); }
/// <summary> /// Initialize program screen cache. /// If any time has change, should be dispose and call GetInstance method again to reset cache. /// </summary> private void InitializeProgramScreens() { m_programScreenList.Clear(); for (int i = 0; i < m_internalScreenCache.InternalScreenList.Count; i++) { InternalScreen internalScreen = m_internalScreenCache.InternalScreenList[i]; if (m_databaseScreenCache.IsFoundDatabaseScreen(internalScreen.ScreenAttribute.ScreenCD)) { // Store program screen cache. ProgramScreen programScreen = new ProgramScreen(internalScreen, m_databaseScreenCache[internalScreen.ScreenAttribute.ScreenCD]); m_programScreenList.Add(programScreen); } } }
/// <summary> /// /// </summary> /// <param name="item"></param> public void Remove(ProgramScreen item) { this.m_programScreenList.Remove(item.DatabaseScreenData.ScreenCD.StrongValue); }