tbf/Config/CalendarEvent/ICalendarEvent.cs

47 lines
2.8 KiB
C#

using System;
using System.Drawing;
namespace Config.CalendarEvent
{
/// <summary>
/// An interface for creating event types
/// </summary>
public interface ICalendarEvent
{
DateTime Date { get; set; } /// The Date that the event occurs
Frequency Frequency { get; set; } /// A value indicating how often the event occurs
bool AllDay { get; set; } /// True if the time component of DateTime value can be ignored
bool TriggerOnExactDayOnly { get; set; } /// If this is a recurring event, set this to true to make the event show up only from the day specified forward
string Source { get; set; } /// Source of this calendar event (becomes the source of the triggered event)
string Title { get; set; } /// The name of the event (becomes the text of the triggered event)
AutoAction AutoAction { get; set; } /// Automated action to be done or event to be triggered (triggered event Severity)
string Parameters { get; set; } /// Automated action parameters (e.g. name of a procedure to start)
int Rank { get; set; } /// The ranking of the event that determines the order in which it is displayed on a particular day
bool Hidden { get; set; } /// True if the event is hidden/invisible, otherwise false
bool ReadOnly { get; set; } /// True if the event details cannot be modified
int BackColor { get; set; } /// The color that the event show up in on the calendar
int TextColor { get; set; } /// The text color of the event
bool TooltipEnabled { get; set; } /// True if a tooltip should be displayed when hovering over the event
/// <summary>
/// Set this to a custom function that will automatically determine if the event should be rendered on a given day.
/// This is only executed if <see cref="Frequency"/> is set to custom.
/// </summary>
CustomRecurringFrequenciesHandler CustomRecurringFunction { get; set; }
/// <summary>
/// A function for cloning an event instance
/// </summary>
/// <returns>A cloned <see cref="ICalendarEvent"/></returns>
ICalendarEvent Clone();
}
/// <summary>
/// A delegate for creating custom recurring frequencies
/// </summary>
/// <param name="evnt">The <see cref="ICalendarEvent"/> in question</param>
/// <param name="day">The day in question</param>
/// <returns>Should return a boolean value that indicates if the event should be rendered on the day passed in</returns>
public delegate bool CustomRecurringFrequenciesHandler(ICalendarEvent evnt, DateTime day);
}