Click here to Skip to main content
15,897,226 members
Articles / Desktop Programming / Windows Forms

BookStore

Rate me:
Please Sign up or sign in to vote.
4.61/5 (25 votes)
24 Apr 2012CPOL5 min read 134.6K   17.8K   98  
A project for managing the digital books (HTML, DOCX, ODF, PDF, EPUB, TXT, etc.) of the user using db4o
using Db4objects.Db4o;

namespace DataAccess
{

    /// <summary>
    /// Activate action class.
    /// </summary>
    class ActivateAction : IUpdateAction
    {

        /// <summary>
        /// The object to be activated.
        /// </summary>
        private object objectToActivate;

        /// <summary>
        /// The depth of the activation in the object graph.
        /// </summary>
        private int activateDepth;


        /// <summary>
        /// DeactivateAction constructor.
        /// </summary>
        /// <param name="objectToActivate">The object to be deactivated</param>
        /// <param name="activateDepth">The depth of the deactivation in the object graph</param>
        public ActivateAction(object objectToActivate, int activateDepth)
        {
            this.objectToActivate = objectToActivate;
            this.activateDepth = activateDepth;
        }


        /// <summary>
        /// Performs the activation action against the database.
        /// </summary>
        /// <param name="db">The database handle</param>
        public void PerformUpdate(IObjectContainer db)
        {
            db.Activate(objectToActivate, activateDepth);
        }

    }

}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Comments and Discussions