Back to Devexpress

AppointmentImporter.Import(Stream) Method

corelibraries-devexpress-dot-xtrascheduler-dot-exchange-dot-appointmentimporter-dot-import-x28-system-dot-io-dot-stream-x29.md

latest3.1 KB
Original Source

AppointmentImporter.Import(Stream) Method

Imports appointments from the specified stream.

Namespace : DevExpress.XtraScheduler.Exchange

Assembly : DevExpress.XtraScheduler.v25.2.Core.dll

NuGet Package : DevExpress.Scheduler.Core

Declaration

csharp
public virtual void Import(
    Stream stream
)
vb
Public Overridable Sub Import(
    stream As Stream
)

Parameters

NameTypeDescription
streamStream

A Stream object which represents the stream the appointments will be imported from.

|

Remarks

This method should be overridden in descendants of the AppointmentImporter class.

If appointments are imported from an MS Outlook calendar, then the Import parameter should be set to Null, as illustrated in the following code snippet:

csharp
using DevExpress.XtraScheduler.Exchange;
using DevExpress.XtraScheduler.Outlook;
//...

// Create an importer class instance.
AppointmentImporter importer = schedulerStorage.CreateOutlookImporter();
// Specify a path to the calendar folder.
((ISupportCalendarFolders)importer).CalendarFolderName = "\\\\Personal Folders\\MyCalendar";

// Prepare a progress bar or perform other actions prior to import.
BeforeImport(importer.SourceObjectCount);

// Perform the import.
// Notice the null stream as a parameter to Import method.
try
    {
    importer.Import(System.IO.Stream.Null);
    }
finally
    {
    AfterImport();
    }
vb
Imports DevExpress.XtraScheduler.Exchange
Imports DevExpress.XtraScheduler.Outlook
'...

' Create an importer class instance.
Dim importer As AppointmentImporter = schedulerStorage.CreateOutlookImporter()
' Specify a path to the calendar folder.
CType(importer, ISupportCalendarFolders).CalendarFolderName = "\\Personal Folders\MyCalendar"

' Prepare a progress bar or perform other actions prior to import.
BeforeImport(importer.SourceObjectCount)

' Perform the import.
' Notice the null stream as a parameter to Import method.
Try
    importer.Import(System.IO.Stream.Null)
Finally
    AfterImport()
End Try

See Also

Export

AppointmentImporter Class

AppointmentImporter Members

DevExpress.XtraScheduler.Exchange Namespace