Example #1
0
        /// <summary>
        /// Deletes the entry.
        /// </summary>
        /// <param name="entry">the EntryNode to be Deleted</param>
        /// <returns>true if the entry was Deleted, else false</returns>
        public bool DeleteEntry(EntryNode entry)
        {
            bool rval =
                ((DirectoryProperty)Property)
                .DeleteChild(entry.Property);

            if (rval)
            {
                _entries.Remove(entry);
                _byname.Remove(entry.Name);

                if (_oFilesSystem != null)
                {
                    _oFilesSystem.Remove(entry);
                }
                else
                {
                    try
                    {
                        _nFilesSystem.Remove(entry);
                    }
                    catch (IOException)
                    {
                        // TODO Work out how to report this, given we can't change the method signature...
                    }
                }
            }
            return(rval);
        }
Example #2
0
 /// <summary>
 /// Removes the specified entry.
 /// </summary>
 /// <param name="entry">The entry.</param>
 public void Remove(EntryNode entry)
 {
     _property_table.RemoveProperty(entry.Property);
     if (entry.IsDocumentEntry)
     {
         _documents.Remove((( DocumentNode )entry).Document);
     }
 }
Example #3
0
        /**
         * remove an entry
         *
         * @param entry to be Removed
         */

        public void Remove(EntryNode entry)
        {
            // If it's a document, free the blocks
            if (entry is DocumentEntry)
            {
                NPOIFSDocument doc = new NPOIFSDocument((DocumentProperty)entry.Property, this);
                doc.Free();
            }
            _property_table.RemoveProperty(entry.Property);
        }
Example #4
0
        /// <summary>
        /// Change a contained Entry's name
        /// </summary>
        /// <param name="oldName">the original name</param>
        /// <param name="newName">the new name</param>
        /// <returns>true if the operation succeeded, else false</returns>
        public bool ChangeName(string oldName, string newName)
        {
            bool      rval  = false;
            EntryNode child = (EntryNode)_byname[oldName];

            if (child != null)
            {
                rval = ((DirectoryProperty)Property)
                       .ChangeName(child.Property, newName);
                if (rval)
                {
                    _byname.Remove(oldName);
                    _byname[child.Property.Name] = child;
                }
            }
            return(rval);
        }