Class ArrayListDataProvider
Derives ScheduleDataProvider and implements IRecurringScheduleDataProvider.
Inherited Members
Namespace: Syncfusion.Schedule
Assembly: Syncfusion.Schedule.Base.dll
Syntax
public class ArrayListDataProvider : ScheduleDataProvider, IScheduleDataProvider, IRecurringScheduleDataProvider
Remarks
This implementation of IRecurringScheduleDataProvider uses two collection of ArrayListAppointment objects to hold the items displayed in the schedule. These collections is serialized to disk as a binary file. The ArrayListDataProvider.MasterList holds the appointment items that appear in the schedule. The ArrayListDataProvider.RecurList holds any non-terminiating appoint definitions.
Constructors
ArrayListDataProvider()
Initializes a new instance of the ArrayListDataProvider class.
Declaration
public ArrayListDataProvider()
Properties
FileName
Gets or sets the file name used to store the serialized data.
Declaration
public string FileName { get; set; }
Property Value
Type |
---|
System.String |
IsDirty
Gets or sets whether the MasterList has been modified.
Declaration
public override bool IsDirty { get; set; }
Property Value
Type |
---|
System.Boolean |
Overrides
MasterList
Gets or sets an IScheduleAppointmentList collection that holds the IRecurringScheduleAppointments.
Declaration
public virtual ArrayListAppointmentList MasterList { get; set; }
Property Value
Type |
---|
ArrayListAppointmentList |
MasterListArray
Gets or sets the MasterListArrray for XML serialization.
Declaration
public virtual ArrayListAppointment[] MasterListArray { get; set; }
Property Value
Type |
---|
ArrayListAppointment[] |
NextUniqueID
Gets or sets the largest ID value used so far in this ScheduleDataProvider.
Declaration
public int NextUniqueID { get; set; }
Property Value
Type |
---|
System.Int32 |
RecurringList
Gets a ArrayListAppointmentList collection that holds ScheduleRecurringAppointments.
Declaration
public IScheduleAppointmentList RecurringList { get; }
Property Value
Type |
---|
IScheduleAppointmentList |
RecurringListArray
Gets or sets RecurringListArray which is used internally for XML serialization.
Declaration
public ArrayListAppointment[] RecurringListArray { get; set; }
Property Value
Type |
---|
ArrayListAppointment[] |
Methods
AddItem(IScheduleAppointment)
Overridden to add the item to the MasterList.
Declaration
public override void AddItem(IScheduleAppointment item)
Parameters
Type | Name | Description |
---|---|---|
IScheduleAppointment | item | IScheduleAppointment item to be added. |
Overrides
AddNewRecurringAppointments(IRecurringScheduleAppointment, DateTime)
Adds recurring appointments.
Declaration
public void AddNewRecurringAppointments(IRecurringScheduleAppointment item, DateTime dateLimit)
Parameters
Type | Name | Description |
---|---|---|
IRecurringScheduleAppointment | item | The recurring appointment definition. |
System.DateTime | dateLimit | A date limit at which the recurring appointments end. |
Remarks
The date limit may be dateTime.MaxValue which indicates no limit.
CheckAndAddIfNeededRecurringAppointments(DateTime)
Used after the initial load to add additional recurring appointments to the data provider.
Declaration
public bool CheckAndAddIfNeededRecurringAppointments(DateTime date)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | date | The recurring appointment definition. |
Returns
Type | Description |
---|---|
System.Boolean | True if dates were added. |
Remarks
Dynamically provide appointments on demand as new dates are exposed.
CommitChanges()
Saves this ArrayListDataProvider object as a disk file.
Declaration
public override void CommitChanges()
Overrides
Remarks
If the FileName ends with ".XML", then the data object is saved to disk as an XML file. If the FileName ends with something else, then the object is saved as a binary file.
GetSchedule(DateTime, DateTime)
Returns a the subset of MasterList between the 2 dates.
Declaration
public override IScheduleAppointmentList GetSchedule(DateTime startDate, DateTime endDate)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | startDate | Starting date limit for the returned items. |
System.DateTime | endDate | Ending date limit for the returned items. |
Returns
Type | Description |
---|---|
IScheduleAppointmentList | Returns a the subset of MasterList. |
Overrides
GetScheduleForDay(DateTime)
Returns a the subset of MasterList for a given date.
Declaration
public override IScheduleAppointmentList GetScheduleForDay(DateTime day)
Parameters
Type | Name | Description |
---|---|---|
System.DateTime | day | Date for the returned items. |
Returns
Type | Description |
---|---|
IScheduleAppointmentList | Returns a the subset of MasterList. |
Overrides
GetUniqueID()
Returns a unique integer that serves to identify a recurring family of appointments.
Declaration
public int GetUniqueID()
Returns
Type | Description |
---|---|
System.Int32 | A unique integer. |
InitializeRandomData()
Provides random data, not really a part of the implementations.
Declaration
public static ArrayListAppointmentList InitializeRandomData()
Returns
Type | Description |
---|---|
ArrayListAppointmentList | A ArrayListAppointmentList object holding sample data. |
InitializeRandomData(IScheduleAppointmentList)
Provides random data, not really a part of the implementations.
Declaration
protected static IScheduleAppointmentList InitializeRandomData(IScheduleAppointmentList masterList)
Parameters
Type | Name | Description |
---|---|---|
IScheduleAppointmentList | masterList | A ScheduleAppointmentList |
Returns
Type | Description |
---|---|
IScheduleAppointmentList | A ArrayListAppointmentList object holding sample data. |
LoadBinary()
Loads a binary file whose name is given by FileName into this class instance.
Declaration
public virtual void LoadBinary()
LoadBinary(String)
Creates an instance of ArrayListDataProvider and loads a previously serialized ArrayListDataProvider into the instance.
Declaration
public static ArrayListDataProvider LoadBinary(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The serialized filename. |
Returns
Type | Description |
---|---|
ArrayListDataProvider | A ArrayListDataProvider. |
Remarks
This method depends upon System.AppDomain.CurrentDomain.AssemblyResolve to avoid versioning issues with the binary serialization of the MasterList.
LoadXML(String)
Creates an instance of ArrayListDataProvider and loads a previously serialized ArrayListDataProvider into the instance from an XML file.
Declaration
public static ArrayListDataProvider LoadXML(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The serialized filename. |
Returns
Type | Description |
---|---|
ArrayListDataProvider | A ArrayListDataProvider. |
NewScheduleAppointment()
An Overridden method to return a ArrayListAppointment.
Declaration
public override IScheduleAppointment NewScheduleAppointment()
Returns
Type | Description |
---|---|
IScheduleAppointment | New ArrayListAppointment. |
Overrides
NewScheduleAppointmentList()
An Overridden method to return a ArrayListAppointmentList.
Declaration
public override IScheduleAppointmentList NewScheduleAppointmentList()
Returns
Type | Description |
---|---|
IScheduleAppointmentList | New ArrayListAppointmentList. |
Overrides
RemoveItem(IScheduleAppointment)
An Overridden method to remove the item from the MasterList.
Declaration
public override void RemoveItem(IScheduleAppointment item)
Parameters
Type | Name | Description |
---|---|---|
IScheduleAppointment | item | IScheduleAppointment item to be removed. |
Overrides
RemoveRecurringAppointments(IRecurringScheduleAppointment)
Removes all occurrences the given appointment.
Declaration
public bool RemoveRecurringAppointments(IRecurringScheduleAppointment recurItem)
Parameters
Type | Name | Description |
---|---|---|
IRecurringScheduleAppointment | recurItem | The recurring appointment to be removed. |
Returns
Type | Description |
---|---|
System.Boolean | True, if the appointment is removed; False otherwise. |
SaveBinary(Stream)
Saves the ArrayListDataProvider object to a stream in binary format.
Declaration
public virtual void SaveBinary(Stream s)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | s | The Stream object. |
SaveBinary(String)
Saves the current ArrayListDataProvider object in binary format to a file with the specified filename.
Declaration
public virtual void SaveBinary(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name. |
SaveModifiedItem(IScheduleAppointment, IScheduleAppointment)
Overridden to make changes to appointments.
Declaration
public override void SaveModifiedItem(IScheduleAppointment appModifiedItem, IScheduleAppointment appOriginalItem)
Parameters
Type | Name | Description |
---|---|---|
IScheduleAppointment | appModifiedItem | The edited appointment. |
IScheduleAppointment | appOriginalItem | The original appointment. |
Overrides
SaveModifiedRecurringAppointment(IRecurringScheduleAppointment, IRecurringScheduleAppointment, RecurringAppointmentEditAction)
Makes changes to appointments in a recurring sequence of appointments.
Declaration
public void SaveModifiedRecurringAppointment(IRecurringScheduleAppointment modifiedItem, IRecurringScheduleAppointment originalItem, RecurringAppointmentEditAction action)
Parameters
Type | Name | Description |
---|---|---|
IRecurringScheduleAppointment | modifiedItem | The edited appointment. |
IRecurringScheduleAppointment | originalItem | The original appointment. |
RecurringAppointmentEditAction | action | The requested edit action. |
SaveXML(String)
Saves this ArrayListDataProvider object in an XML file with the specified filename.
Declaration
public virtual void SaveXML(string fileName)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The file name. |