/// <summary> /// Removes an existing items from the dictionary /// </summary> /// <param name="inf">The info item to remove as a 'DictionaryInfo'</param> public void Remove(DictionaryInfo inf) { try { dicList.Remove(inf); } catch { throw new Exception("InfNotFoundInDictinaryException"); }; }
/// <summary> /// Adds a new dictionary info item to the dictionary /// </summary> /// <param name="inf">The info item to add as a 'DictionaryInfo'</param> public void Add(string title, string description) { var inf = new DictionaryInfo() { Title = title, Description = description }; inf.Index = dicList.Count + 1; dicList.Add(inf); }
/// <summary> /// Edits the specified dictionary info item according to the specified value /// </summary> /// <param name="inf">The desired info item from the dictionary</param> /// <param name="title">The new title. This value can be null to return the existing title</param> /// <param name="description">The new description. This value can be null to return the existing description</param> public void Edit(DictionaryInfo inf, string title, string description) { if (dicList.Contains(inf)) { var x = new DictionaryInfo() { Index = inf.Index, Title = title, Description = description }; dicList.RemoveAt(inf.Index); dicList.Insert(inf.Index, x); } else { throw new Exception("ElementNotFoundException"); }; }
/// <summary> /// Edits the specified dictionary info item according to the specified value /// </summary> /// <param name="inf">The desired info item from the dictionary</param> /// <param name="title">The new title. This value can be null to return the existing title</param> /// <param name="description">The new description. This value can be null to return the existing description</param> public void Edit(DictionaryInfo inf, string title, string description) { if (dicList.Contains(inf)) { var x = new DictionaryInfo() { Index = inf.Index, Title = title, Description = description }; dicList.RemoveAt(inf.Index); dicList.Insert(inf.Index, x); } else { throw new Exception("ElementNotFoundException"); }; }
/// <summary> /// Checks wheather a dictionary info item that has the same /// Title, Description and Index exists in the dictionary or not /// </summary> /// <param name="inf">The dictionary info item to check for</param> /// <returns></returns> public bool Exists(DictionaryInfo inf) { return dicList.Contains(inf); }
/// <summary> /// Removes an existing items from the dictionary /// </summary> /// <param name="inf">The info item to remove as a 'DictionaryInfo'</param> public void Remove(DictionaryInfo inf) { try { dicList.Remove(inf); } catch { throw new Exception("InfNotFoundInDictinaryException"); }; }
/// <summary> /// Adds a new dictionary info item to the dictionary /// </summary> /// <param name="inf">The info item to add as a 'DictionaryInfo'</param> public void Add(string title, string description) { var inf = new DictionaryInfo() { Title = title, Description = description }; inf.Index = dicList.Count + 1; dicList.Add(inf); }
/// <summary> /// Adds a new dictionary info item to the dictionary /// </summary> /// <param name="inf">The info item to add as a 'DictionaryInfo'</param> public void Add(DictionaryInfo inf) { inf.Index = dicList.Count + 1; dicList.Add(inf); }
/// <summary> /// Checks wheather a dictionary info item that has the same /// Title, Description and Index exists in the dictionary or not /// </summary> /// <param name="inf">The dictionary info item to check for</param> /// <returns></returns> public bool Exists(DictionaryInfo inf) { return(dicList.Contains(inf)); }
/// <summary> /// Adds a new dictionary info item to the dictionary /// </summary> /// <param name="inf">The info item to add as a 'DictionaryInfo'</param> public void Add(DictionaryInfo inf) { inf.Index = dicList.Count + 1; dicList.Add(inf); }