Example #1
0
        /// <summary>
        /// Removes an object from the collection.
        /// </summary>
        /// <param name="key">The key of the object to remove</param>
        protected void Remove(KeyBase key)
        {
            innerList.Remove(key);

            // Remove it from the key map as well
            keyMap.Remove(key.Id);
        }
Example #2
0
        /// <summary>
        /// Adds a new object to the collection.
        /// </summary>
        /// <param name="key">The key of the object.</param>
        /// <param name="obj">The object to add</param>
        protected void Add(KeyBase key, PhotoObjectBase obj)
        {
            innerList.Add(key, obj);

            // Keep a map of the keys to the IDs
            keyMap.Add(obj.Id, key);
        }
Example #3
0
 public PhotoObjectBase this[int id]
 {
     get
     {
         KeyBase base2 = (KeyBase)this.keyMap[id];
         return((PhotoObjectBase)this.innerList[base2]);
     }
 }
Example #4
0
 /// <summary>
 /// The indexer for the PhotoCollectionBase collection class.
 /// </summary>
 public PhotoObjectBase this[int id]
 {
     get
     {
         // Use the kay map to retrieve the KeyBase object based upon the
         // ID of the PhotoObjectBase
         KeyBase key = (KeyBase)keyMap[id];
         return((PhotoObjectBase)innerList[key]);
     }
 }
Example #5
0
        public void Add(Comment comment)
        {
            KeyBase key = this.CreateKey(comment);

            base.Add(key, comment);
        }
Example #6
0
File: Photos.cs Project: ishui/rms2
        public void Add(Photo photo)
        {
            KeyBase key = this.CreateKey(photo);

            base.Add(key, photo);
        }
Example #7
0
        /// <summary>
        /// Adds a PhotoDirectory object to the collection.
        /// </summary>
        /// <param name="photoDirectory">The PhotoDirectory object to add.</param>
        public void Add(PhotoDirectory photoDirectory)
        {
            KeyBase key = CreateKey(photoDirectory);

            Add(key, photoDirectory);
        }
Example #8
0
        public void Add(PhotoDirectory photoDirectory)
        {
            KeyBase key = this.CreateKey(photoDirectory);

            base.Add(key, photoDirectory);
        }
Example #9
0
        /// <summary>
        /// Adds a Comment object to the collection.
        /// </summary>
        /// <param name="comment">The Comment object to add.</param>
        public void Add(Comment comment)
        {
            KeyBase key = CreateKey(comment);

            Add(key, comment);
        }
Example #10
0
        /// <summary>
        /// Returns the zero-based index of the specified key in the PhotosCollectionBase.
        /// </summary>
        /// <param name="key">The key to locate in the PhotosCollectionBase. </param>
        /// <returns>The zero-based index of key, if key is found in the PhotosCollectionBase; otherwise, -1.</returns>
        public int IndexOf(PhotoObjectBase obj)
        {
            KeyBase key = CreateKey(obj);

            return(innerList.IndexOfKey(key));
        }
Example #11
0
        /// <summary>
        /// Adds a Photo object to the collection.
        /// </summary>
        /// <param name="photo">The Photo object to add.</param>
        public void Add(Photo photo)
        {
            KeyBase key = CreateKey(photo);

            Add(key, photo);
        }
Example #12
0
 protected void Remove(KeyBase key)
 {
     this.innerList.Remove(key);
     this.keyMap.Remove(key.Id);
 }
Example #13
0
 protected void Add(KeyBase key, PhotoObjectBase obj)
 {
     this.innerList.Add(key, obj);
     this.keyMap.Add(obj.Id, key);
 }