Microsoft.SharePoint.WebCon ...


ISPCalendarSettings Interface (Microsoft.SharePoint.WebControls)

Namespace: Microsoft.SharePoint.WebControls
Assembly: Microsoft.SharePoint (in microsoft.sharepoint.dll)
Syntax

Visual Basic (Declaration)
Public Interface ISPCalendarSettings
Visual Basic (Usage)
Dim instance As ISPCalendarSettings
C#
public interface ISPCalendarSettings
See Also

Tags :


Community Content

Adam Buenz - MVP
ISPCalendarSettings

Description

The Microsoft.SharePoint.WebControls.ISPCalendarSettings interface to enforce exposed common properties related to Calendars. An ISPCalendarSettings object provides a typed representation of all the settings related to a Calender.

The member properties exposed by this interface are:

AlternateCalendarType – SPCalendarType representing the alternate to the CalendarType property, such as Hijri, Hebrew, or others
CalendarType - SPCalendarType representing the calendar type
DisplayItemFormUrl – string representing the Url to the Display PageForm of the calendar
EditItemFormUrl – string representing the Url to the Edit PageForm of the calendar
FirstDayOfWeek - integer representing the first day of the week incremenet
HijriAdjustment – integer representing the value to synchronize Hijiri adjustments
LocaleId – integer representing the calendar Locale
NewItemFormUrl - string representing the Url to the New PageForm of the calendar
SelectedDate – string representing the selected date
Time24 – Boolean representing whether the day is specified in 24 hour format
TimeZoneSpan – TimeSpan representing the days time interval of the current calendar
ViewName – string representing the calendar default view name
WorkDayEndHour – short representing the ending hour for a calendar work day
WorkDayStartHour - short representing the starting hour for a calendar work day
WorkWeek – string representing a seven character string to indicate work days in a week

The most useful scenario for the use of ISPCalendarSettings is when building custom class similar to Microsoft.SharePoint.WebControls.SPCalendarContainer which provides to support for calendar views.

Usage Scenario

The primary usage of ISPCalendarSettings is internal, represented within the shipped software in both SPCalendarBase and SPCalendarContainer to expose calendar settings. Within custom development it is feasible to inherit from the ISPCalendarSettings interface to support the development of custom calendar containers (similar to SPCalendarContainer) which can later be used within custom calendar views inheriting from DataBoundControl.

In the below, the abstract MyClass is inheriting from ISPCalendarSettings interface, and implementing all the required member properties with relevant backing fields allowing them to be manipulated before the interface is used as a base class for a custom calendar container class. Since the class is marked as abstract, further behavior can be defined to package more implementation tools.

C# Code Example

public abstract class MyClass : ISPCalendarSettings
{
public abstract string ViewName { get; set; }
public abstract string SelectedDate { get; set; }
public abstract string NewItemFormUrl { get; set; }
public abstract string EditItemFormUrl { get; set; }
public abstract string DisplayItemFormUrl { get; set; }
public abstract int LocaleId { get; }
public abstract SPCalendarType CalendarType { get; }
public abstract SPCalendarType AlternateCalendarType { get; }
public abstract bool Time24 { get; }
public abstract int FirstDayOfWeek { get; }
public abstract string WorkWeek { get; }
public abstract int HijriAdjustment { get; }
public abstract TimeSpan TimeZoneSpan { get; }
public abstract short WorkDayStartHour { get; }
public abstract short WorkDayEndHour { get; }
}

VB.NET Code Example

Public MustInherit Class [MyClass]
Implements ISPCalendarSettings
Public MustOverride Property ViewName() As String
Public MustOverride Property SelectedDate() As String
Public MustOverride Property NewItemFormUrl() As String
Public MustOverride Property EditItemFormUrl() As String
Public MustOverride Property DisplayItemFormUrl() As String
Public MustOverride ReadOnly Property LocaleId() As Integer
Public MustOverride ReadOnly Property CalendarType() As SPCalendarType
Public MustOverride ReadOnly Property AlternateCalendarType() As SPCalendarType
Public MustOverride ReadOnly Property Time24() As Boolean
Public MustOverride ReadOnly Property FirstDayOfWeek() As Integer
Public MustOverride ReadOnly Property WorkWeek() As String
Public MustOverride ReadOnly Property HijriAdjustment() As Integer
Public MustOverride ReadOnly Property TimeZoneSpan() As TimeSpan
Public MustOverride ReadOnly Property WorkDayStartHour() As Short
Public MustOverride ReadOnly Property WorkDayEndHour() As Short
End Class


Tags :

Page view tracker