Example #1
0
 /// <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"); };
 }
Example #2
0
        /// <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);
        }
Example #3
0
        /// <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");
            };
        }
Example #4
0
        /// <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");
            };
        }
Example #5
0
 /// <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);
 }
Example #6
0
 /// <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"); };
 }
Example #7
0
 /// <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);
 }
Example #8
0
 /// <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);
 }
Example #9
0
 /// <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));
 }
Example #10
0
 /// <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);
 }