Inheritance: InventoryFolderBase
Ejemplo n.º 1
0
        /// <summary>
        ///     Get a child folder
        /// </summary>
        /// <param name="folderID"></param>
        /// <returns>The folder if it exists, null if it doesn't</returns>
        public InventoryFolderImpl GetChildFolder(UUID folderID)
        {
            InventoryFolderImpl folder = null;

            lock (m_childFolders)
            {
                m_childFolders.TryGetValue(folderID, out folder);
            }

            return(folder);
        }
        /// <summary>
        ///     Removes the given child subfolder.
        /// </summary>
        /// <param name="folderID"></param>
        /// <returns>
        ///     The folder removed, or null if the folder was not present.
        /// </returns>
        public InventoryFolderImpl RemoveChildFolder(UUID folderID)
        {
            InventoryFolderImpl removedFolder = null;

            lock (m_childFolders) {
                if (m_childFolders.ContainsKey(folderID))
                {
                    removedFolder = m_childFolders [folderID];
                    m_childFolders.Remove(folderID);
                }
            }

            return(removedFolder);
        }
        /// <summary>
        ///     Create a new subfolder.
        /// </summary>
        /// <param name="folderID"></param>
        /// <param name="folderName"></param>
        /// <param name="type"></param>
        /// <returns>The newly created subfolder.  Returns null if the folder already exists</returns>
        public InventoryFolderImpl CreateChildFolder(UUID folderID, string folderName, ushort type)
        {
            lock (m_childFolders) {
                if (!m_childFolders.ContainsKey(folderID))
                {
                    InventoryFolderImpl subFold = new InventoryFolderImpl {
                        Name     = folderName,
                        ID       = folderID,
                        Type     = (short)type,
                        ParentID = ID,
                        Owner    = Owner
                    };
                    m_childFolders.Add(subFold.ID, subFold);

                    return(subFold);
                }
            }

            return(null);
        }
        /// <summary>
        ///     Create a new subfolder.
        /// </summary>
        /// <param name="folderID"></param>
        /// <param name="folderName"></param>
        /// <param name="type"></param>
        /// <returns>The newly created subfolder.  Returns null if the folder already exists</returns>
        public InventoryFolderImpl CreateChildFolder (UUID folderID, string folderName, ushort type)
        {
            lock (m_childFolders) {
                if (!m_childFolders.ContainsKey (folderID)) {
                    InventoryFolderImpl subFold = new InventoryFolderImpl {
                        Name = folderName,
                        ID = folderID,
                        Type = (short)type,
                        ParentID = ID,
                        Owner = Owner
                    };
                    m_childFolders.Add (subFold.ID, subFold);

                    return subFold;
                }
            }

            return null;
        }
 /// <summary>
 ///     Add a folder that already exists.
 /// </summary>
 /// <param name="folder"></param>
 public void AddChildFolder (InventoryFolderImpl folder)
 {
     lock (m_childFolders) {
         folder.ParentID = ID;
         m_childFolders [folder.ID] = folder;
     }
 }