Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public static fields | Public Member Functions | List of all members
Loyc.SyncLib.Impl.SyncTime< SM > Struct Template Reference

The default synchronizer for times and dates (DateTime, DateTimeOffset and TimeSpan), used by the Sync extension methods in SyncTimeExt. In plain-text formats, values are written as strings in the same way as Newtonsoft.Json (see SyncTimeAsString{SM}); otherwise they are written as integers (see SyncTimeAsTicks{SM}). When reading, the type of the field in the data stream (if available) determines which representation is parsed, so either representation can be read back. More...


Source file:
Inheritance diagram for Loyc.SyncLib.Impl.SyncTime< SM >:
Loyc.SyncLib.ISyncField< SyncManager, T > Loyc.SyncLib.ISyncField< SyncManager, T > Loyc.SyncLib.ISyncField< SyncManager, T > Loyc.SyncLib.ISyncField< SyncManager, T > Loyc.SyncLib.ISyncField< SyncManager, T > Loyc.SyncLib.ISyncField< SyncManager, T >

Remarks

The default synchronizer for times and dates (DateTime, DateTimeOffset and TimeSpan), used by the Sync extension methods in SyncTimeExt. In plain-text formats, values are written as strings in the same way as Newtonsoft.Json (see SyncTimeAsString{SM}); otherwise they are written as integers (see SyncTimeAsTicks{SM}). When reading, the type of the field in the data stream (if available) determines which representation is parsed, so either representation can be read back.

Type Constraints
SM :ISyncManager 

Public static fields

static SyncTimeAsString< SM > AsString => new SyncTimeAsString<SM>(null, DateTimeStyles.RoundtripKind)
 
static SyncTimeAsTicks< SM > AsTicks => new SyncTimeAsTicks<SM>()
 

Public Member Functions

DateTime Sync (ref SM sync, FieldId name, DateTime value)
 
DateTime Sync (ref SM sync, FieldId name, DateTime?value)
 
DateTimeOffset Sync (ref SM sync, FieldId name, DateTimeOffset value)
 
DateTimeOffset Sync (ref SM sync, FieldId name, DateTimeOffset?value)
 
TimeSpan Sync (ref SM sync, FieldId name, TimeSpan value)
 
TimeSpan Sync (ref SM sync, FieldId name, TimeSpan?value)
 
- Public Member Functions inherited from Loyc.SyncLib.ISyncField< SyncManager, T >
Sync (ref SyncManager sync, FieldId name, T?value)