Back to Devexpress

DXGoogleCalendarSync.StateTrackingMode Property

windowsforms-devexpress-dot-xtrascheduler-dot-googlecalendar-dot-dxgooglecalendarsync-7dcf24d5.md

latest5.8 KB
Original Source

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.v25.2.GoogleCalendar.dll

NuGet Package : DevExpress.Win.Scheduler.GoogleCalendar

Declaration

csharp
[DefaultValue(StateTrackingMode.Auto)]
public StateTrackingMode StateTrackingMode { get; set; }
vb
<DefaultValue(StateTrackingMode.Auto)>
Public Property StateTrackingMode As StateTrackingMode

Property Value

TypeDefaultDescription
StateTrackingModeAuto

A StateTrackingMode enumerator value that specifies whether the DXGoogleCalendarSync component should automatically write session information to an XML file.

|

Available values:

NameDescription
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:

csharp
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();
}
vb
Imports DevExpress.XtraScheduler.GoogleCalendar

Public Sub New()
    InitializeComponent()
    UpdateFormState()
    dxGoogleCalendarSync1.StateTrackingMode = StateTrackingMode.Manual
    schedulerControl1.Start = Date.Now
    AddHandler Me.Load, AddressOf Form1_Load
    AddHandler Me.FormClosing, AddressOf Form1_FormClosing
End Sub

Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As FormClosingEventArgs)
    Me.dxGoogleCalendarSync1.Save()
End Sub

Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
    Me.dxGoogleCalendarSync1.Load()
End Sub

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.

See Also

Google Calendars

DXGoogleCalendarSync Class

DXGoogleCalendarSync Members

DevExpress.XtraScheduler.GoogleCalendar Namespace