<ig:XamScheduleDataManager Name="dataManager">
<ig:XamScheduleDataManager.DataConnector>
<ig:ExchangeScheduleDataConnector Name="exchangeConnector" />
</ig:XamScheduleDataManager.DataConnector>
</ig:XamScheduleDataManager>
This topic introduces and explains the use of the Exchange Data Connector, a component used to connect the xamSchedule control to an Exchange Server.
The topic is organized as follows:
Introduction
Creating an Exchange Data Connector
Connecting to an Exchange Server
Configuring Updates
Disconnecting from an Exchange Server
Related Topics
The xamSchedule control connects to an Exchange Server using a non-visual component called Exchange Data Connector. The Exchange Data Connector connects the xamSchedule to an Exchange Server residing on the same domain as the user’s machine. It also enables you to view and edit schedule data stored on the Exchange Server.
Creating an Exchange Data Connector is easy – just instantiate it in code-behind or declare it in the XAML and attach it to the Data Manager as shown below:
In XAML:
<ig:XamScheduleDataManager Name="dataManager">
<ig:XamScheduleDataManager.DataConnector>
<ig:ExchangeScheduleDataConnector Name="exchangeConnector" />
</ig:XamScheduleDataManager.DataConnector>
</ig:XamScheduleDataManager>
In Visual Basic:
Dim connector As New ExchangeScheduleDataConnector()
Dim dataManager As New XamScheduleDataManager()
dataManager.DataConnector = connector
In C#:
ExchangeScheduleDataConnector connector = new ExchangeScheduleDataConnector();
XamScheduleDataManager dataManager = new XamScheduleDataManager();
dataManager.DataConnector = connector;
To connect to an Exchange Server:
Set URL of the Exchange Server.
Create an ExchangeServerConnectionSettings instance and set the Exchange Server connection URL into its Url property.
Set the Exchange Server’s version.
Set the Exchange Server version in the RequestedServerVersion property. Set the ExchangeServerConnectionSettings instance to the connector’s ServerConnectionSettings property.
Provide Exchange Server user credentials.
Add an ExchangeUser instance with valid credentials in the connector’s Users collection.
Invoke the connect method.
Example of setting up the connector and invoking the Connect method:
In Visual Basic:
Dim users As New List(Of ExchangeUser)()
users.Add(New ExchangeUser("user-name", "user-password", "domain"))
connector.Users = users
connector.ServerConnectionSettings =_
New ExchangeServerConnectionSettings()
connector.ServerConnectionSettings.RequestedServerVersion =_
ExchangeVersion.Exchange2007_SP1
connector.ServerConnectionSettings.Url =_
New Uri("https://exchange.mydomain.local/exchange.asmx")
connector.Connect()
In C#:
List<ExchangeUser> users = new List<ExchangeUser>();
users.Add(new ExchangeUser("user-name", "user-password", "domain"));
connector.Users = users;
connector.ServerConnectionSettings = new ExchangeServerConnectionSettings();
connector.ServerConnectionSettings.RequestedServerVersion =
ExchangeVersion.Exchange2007_SP1;
connector.ServerConnectionSettings.Url =
new Uri("https://exchange.mydomain.local/exchange.asmx");
connector.Connect();
Display the activities of a specific user.
Configure the CurrentUserId property of the Data Manager. You need to specify the domain and the user name in lower case like this:
In Visual Basic:
dataManager.CurrentUserId = "domain\\user-name"
In C#:
dataManager.CurrentUserId = "domain\\user-name";
After successfully connecting to the Exchange Server, the connector will retrieve the available schedule information and the selected user activities will be displayed in all xamSchedule views attached to the Data Manager.
The information is periodically updated. You have the options to either configure the update period or to force immediate data update:
to configure the update period, use the PollingInterval property
to force immediate update, use the PollForChanges method
In addition to that, there is a property called IsPolling, which can be used to determine whether data has actually been obtained at the moment of invocation from the Exchange Server.
To disconnect from an Exchange Server, invoke the Disconnect method or clear the ServerConnectionsSettings property.