Click here to Skip to main content
15,881,173 members
Articles / Programming Languages / XML

SharePoint Reservations

Rate me:
Please Sign up or sign in to vote.
4.93/5 (15 votes)
29 Mar 2009CPOL8 min read 420.7K   4K   47  
A SharePoint calendar extension that prohibits overlapping appointments
using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;


namespace RecurringClasses
{
    /// <summary>
    /// Concrete class to handle repeat forever.
    /// Had to put a limit to date, picked 5 years
    /// J. Finn Sep 2008
    /// james.finn@gmail.com
    /// </summary>
    class RecurForever : absCompletion
    {
        const int MAX_YEARS = 5; // quit after MAX_YEARS
        DateTime CutOffDate = DateTime.Now.AddYears(MAX_YEARS);

        /// <summary>
        /// constructor sets up variables necessary to respond to ProcecessedAll
        /// </summary>
        /// <param name="StartDate">Start Date</param>
        /// <param name="EndDate">End Date</param>
        /// <param name="ReccurNode">XML Node containing completion data</param>
        public RecurForever(ref DateTime StartDate, ref DateTime EndDate, XmlNode ReccurNode)
            : base(StartDate, EndDate)
        {
        }

        /// <summary>
        /// Have all events been processed?
        /// </summary>
        /// <param name="StartDate">Start Date</param>
        /// <param name="EndDate">End Date</param>
        /// <returns>true if all events are processed</returns>
        public override bool ProcessedAll(DateTime StartDate, DateTime EndDate)
        {
            return (StartDate < CutOffDate);
        }
    }
}

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)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions