DXGoogleCalendarSync.StateTrackingMode Property
Gets or sets whether the DXGoogleCalendarSync component should automatically write session information to an XML file.
Namespace: DevExpress.XtraScheduler.GoogleCalendar
Assembly: DevExpress.XtraScheduler.v24.1.GoogleCalendar.dll
NuGet Package: DevExpress.Win.Scheduler.GoogleCalendar
Declaration
[DefaultValue(StateTrackingMode.Auto)]
public StateTrackingMode StateTrackingMode { get; set; }
Property Value
Type | Default | Description |
---|---|---|
StateTrackingMode | Auto | A StateTrackingMode enumerator value that specifies whether the DXGoogleCalendarSync component should automatically write session information to an XML file. |
Available values:
Name | Description |
---|---|
Auto | The DXGoogleCalendarSync automatically logs user activity and writes session information to an .xml file located in the working directory. You can call the DXGoogleCalendarSync.Save / DXGoogleCalendarSync.Load method overloads with no parameters to trigger this process. Alternatively, use method overloads which take the “Stream” parameter to save session info elsewhere. |
Manual | The DXGoogleCalendarSync does not automatically log user activity. If needed, you can call parameterized DXGoogleCalendarSync.Save / DXGoogleCalendarSync.Load method overloads to manually save session information. |
Remarks
If the DXGoogleCalendarSync component finds a scheduler appointment with the same ID as an existing Google Event but these objects contents differ, the component uses logged session information to determine whether it should assign Event data to an Appointment, or vice versa.
DXGoogleCalendarSync automatically writes this session information to the DXGoogleCalendarSync.xml file inside your project folder upon any Appointment edit.
Set the StateTrackingMode
property to StateTrackingMode.Manual and call the DXGoogleCalendarSync.Save / DXGoogleCalendarSync.Load methods to manually save the session information:
using DevExpress.XtraScheduler.GoogleCalendar;
public Form1() {
InitializeComponent();
UpdateFormState();
dxGoogleCalendarSync1.StateTrackingMode = StateTrackingMode.Manual;
schedulerControl1.Start = DateTime.Now;
this.Load += Form1_Load;
this.FormClosing += Form1_FormClosing;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e) {
this.dxGoogleCalendarSync1.Save();
}
private void Form1_Load(object sender, EventArgs e) {
this.dxGoogleCalendarSync1.Load();
}
If you edit both a Google Event and its matching Appointment, and then call the DevExpress.XtraScheduler.GoogleCalendar.DXGoogleCalendarSync.Sync method, session info will not be enough to determine which of the Event-Appointment object pair should be taken as a “valid” object. In these cases the DXGoogleCalendarSync.ConflictDetected event raises.