windowsforms-devexpress-dot-xtrascheduler-dot-microsoft365calendar-dot-dxoutlook365sync-2c095fc1.md
Occurs once the initialization of DXOutlook365Sync is finished (with or without errors).
Namespace : DevExpress.XtraScheduler.Microsoft365Calendar
Assembly : DevExpress.XtraScheduler.v25.2.Microsoft365Calendar.dll
NuGet Package : DevExpress.Scheduler.Core.Desktop.Microsoft365Calendar
public event EventHandler<InitCompleteEventArgs> InitComplete
Public Event InitComplete As EventHandler(Of InitCompleteEventArgs)
The InitComplete event's data class is InitCompleteEventArgs. The following properties provide information specific to this event:
| Property | Description |
|---|---|
| InitStatus | Gets a value that indicates whether DXOutlook365Sync initialization succeeded or failed. |
The DXOutlook365Sync component raises the InitComplete event once its initialization is finished. The e.InitStatus parameter specifies whether the initialization succeeded or failed. Use the e.Exception property to get the description of the exception.
using DevExpress.XtraScheduler.Microsoft365Calendar;
DXOutlook365Sync dxOutlook365Sync1;
public Form1() {
InitializeComponent();
dxOutlook365Sync1 = new DXOutlook365Sync(schedulerDataStorage1);
dxOutlook365Sync1.InitComplete += DxOutlook365Sync1_InitComplete;
}
private async Task<bool> InitOutlook365Sync(DXOutlook365Sync outlook365sync) {
// Initializes the 'dxOutlook365Sync1' component.
string tenantId = "..."; // Enter your tenant (directory) ID.
string clientId = "..."; // Enter your client (application) ID.
InitStatus status = await outlook365sync.InitAsync(tenantId, clientId);
// Returns false if the initialization of 'dxOutlook365Sync1' failed.
return status != InitStatus.Error;
}
private void DxOutlook365Sync1_InitComplete(object sender, InitCompleteEventArgs e) {
if(e.InitStatus == InitStatus.Error)
XtraMessageBox.Show(String.Format("Initialization of DXOutlook365Sync failed. {0}", e.Exception.Message), "Error", MessageBoxButtons.OK);
}
Imports DevExpress.XtraScheduler.Microsoft365Calendar
Private dxOutlook365Sync1 As DXOutlook365Sync
Public Sub New()
InitializeComponent()
dxOutlook365Sync1 = New DXOutlook365Sync(schedulerDataStorage1)
AddHandler dxOutlook365Sync1.InitComplete, AddressOf DxOutlook365Sync1_InitComplete
End Sub
Private Async Function InitOutlook365Sync(ByVal outlook365sync As DXOutlook365Sync) As Task(Of Boolean)
' Initializes the 'dxOutlook365Sync1' component.
Dim tenantId As String = "..." ' Enter your tenant (directory) ID.
Dim clientId As String = "..." ' Enter your client (application) ID.
Dim status As InitStatus = Await outlook365sync.InitAsync(tenantId, clientId)
' Returns false if the initialization of 'dxOutlook365Sync1' failed.
Return status IsNot InitStatus.Error
End Function
Private Sub DxOutlook365Sync1_InitComplete(ByVal sender As Object, ByVal e As InitCompleteEventArgs)
If e.InitStatus = InitStatus.Error Then
XtraMessageBox.Show(String.Format("Initialization of DXOutlook365Sync failed. {0}", e.Exception.Message), "Error", MessageBoxButtons.OK)
End If
End Sub
Read the following topic for detailed information and examples: Synchronization with Microsoft 365 Calendars.
The following code snippets (auto-collected from DevExpress Examples) contain references to the InitComplete event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-scheduler-synchronize-appointments-with-outlook-365/CS/DXOutlook365Sync/Form1.cs#L22
gridControl1.DataSource = source;
dxOutlook365Sync1.InitComplete += DxOutlook365Sync1_InitComplete;
dxOutlook365Sync1.MergeSingleItem += DxOutlook365Sync1_MergeSingleItem;
wpf-scheduler-synchronize-appointments-with-outlook-365/CS/Outlook365Sync/MainWindow.xaml.cs#L14
dXOutlook365Sync = new DXOutlook365Sync(uiScheduler.CreateStorageAdapter());
dXOutlook365Sync.InitComplete += OnInitComplete;
dXOutlook365Sync.CalendarSynchronizeComplete += OnCalendarSynchronizeComplete;
winforms-scheduler-synchronize-appointments-with-outlook-365/VB/DXOutlook365Sync/Form1.vb#L23
gridControl1.DataSource = source
AddHandler dxOutlook365Sync1.InitComplete, AddressOf DxOutlook365Sync1_InitComplete
AddHandler dxOutlook365Sync1.MergeSingleItem, AddressOf DxOutlook365Sync1_MergeSingleItem
See Also