- mullivan.sharepoint.zip
- Build
- Features
- AdUserInfoUpdate
- Reminder
- gacutil.exe
- Images
- ReminderSettings.gif
- Layouts
- Mullivan.Extensibility.dll
- Mullivan.Extensibility.dll.config
- Mullivan.Extensibility.pdb
- Mullivan.Shared.dll
- Mullivan.Shared.pdb
- Mullivan.SharePoint.dll
- Mullivan.SharePoint.Pages.dll
- Mullivan.SharePoint.Pages.pdb
- Mullivan.SharePoint.pdb
- Mullivan.SharePoint.Reminders.dll
- Mullivan.SharePoint.Reminders.pdb
- Mullivan.SharePoint.Remote.dll
- Mullivan.SharePoint.Remote.dll.config
- Mullivan.SharePoint.Remote.pdb
- Mullivan.SharePoint.WebParts.dll
- Mullivan.SharePoint.WebParts.pdb
- Update SharePoint.bat
- WebpartFiles
- LibraryNavigationWebPart.webpart
- ListQueryResultsWebPart.webpart
- ListQueryWebPart.webpart
- MostViewedWebPart.webpart
- WeatherWebPart.webpart
- Mullivan.Shared
- Collections
- Generic
- Cryptography
- Logging
- Mullivan.Shared.csproj
- Mullivan.Shared.csproj.user
- Mullivan.snk
- Properties
- Security
- Serialization
- Mullivan.SharePoint.Pages
- Mullivan.SharePoint.Reminders
- Mullivan.SharePoint.Remote
- Mullivan.SharePoint.sln
- Mullivan.SharePoint.WebParts
- Mullivan.SharePoint
|
using System;
using System.Collections.Generic;
using System.Text;
namespace Mullivan.SharePoint.Reminders
{
public class RmdWeeklyRecurrence : RmdRecurrence
{
public override string Name
{
get { return "Weekly"; }
}
public int StartHour
{
get;
set;
}
public DayOfWeek DayOfWeek
{
get;
set;
}
public override bool CanRun(DateTime lastRun)
{
DateTime dtNow = DateTime.Now;
//If never run then run
if (lastRun.Equals(DateTime.MinValue))
return true;
//If there is a week between the two then it needs to run
if (dtNow.Subtract(lastRun).Days > 7)
return true;
//Create nextOccurence with this day and start hour
DateTime nextOccurence = new DateTime(lastRun.Year, lastRun.Month, lastRun.Day, this.StartHour, 0, 0);
//Add a day if the lastRun is already greater than equal to the StartHour
if(nextOccurence.DayOfWeek == this.DayOfWeek &&
lastRun.Hour >= this.StartHour)
nextOccurence = nextOccurence.Add(new TimeSpan(1, 0, 0, 0));
//add a day until we get the correct day of week
while (nextOccurence.DayOfWeek != this.DayOfWeek)
nextOccurence = nextOccurence.Add(new TimeSpan(1, 0, 0, 0));
if (dtNow >= nextOccurence)
return true;
return false;
}
}
}
|
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.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.