C# Class Microsoft.Samples.Synchronization.ClientServices.Formatters.ODataAtomWriter

SyncWriter implementation for the OData Atompub format
Inheritance: SyncWriter
显示文件 Open project: rafek/SyncFx

Public Methods

Method Description
ODataAtomWriter ( Uri serviceUri ) : System

Constructor

StartFeed ( bool isLastBatch, byte serverBlob ) : void

Should be called prior to any Items are added to the stream. This ensures that the stream is set up with the right doc level feed parameters

WriteFeed ( XmlWriter writer ) : void

Called by the runtime when all entities are written and contents needs to flushed to the underlying stream.

WriteItemInternal ( IOfflineEntity live, string liveTempId, IOfflineEntity conflicting, string conflictingTempId, string desc, bool isConflict, bool emitMetadataOnly ) : void

Adds an IOfflineEntity and its associated Conflicting/Error entity as an Atom entry element

Private Methods

Method Description
WriteEntityContents ( IOfflineEntity entity ) : System.Xml.Linq.XElement

This writes the public contents of the Entity in the properties element.

WriteEntry ( IOfflineEntity live, string tempId, bool emitPartial ) : System.Xml.Linq.XElement

Writes the tag and all its related elements.

Method Details

ODataAtomWriter() public method

Constructor
public ODataAtomWriter ( Uri serviceUri ) : System
serviceUri System.Uri Service Url to include as the base namespace
return System

StartFeed() public method

Should be called prior to any Items are added to the stream. This ensures that the stream is set up with the right doc level feed parameters
public StartFeed ( bool isLastBatch, byte serverBlob ) : void
isLastBatch bool Whether this feed will be the last batch or not.
serverBlob byte Sync server blob.
return void

WriteFeed() public method

Called by the runtime when all entities are written and contents needs to flushed to the underlying stream.
public WriteFeed ( XmlWriter writer ) : void
writer System.Xml.XmlWriter XmlWriter to which this feed will be serialized to
return void

WriteItemInternal() public method

Adds an IOfflineEntity and its associated Conflicting/Error entity as an Atom entry element
public WriteItemInternal ( IOfflineEntity live, string liveTempId, IOfflineEntity conflicting, string conflictingTempId, string desc, bool isConflict, bool emitMetadataOnly ) : void
live IOfflineEntity Live Entity
liveTempId string TempId for the live entity
conflicting IOfflineEntity Conflicting entity that will be sent in synnConflict or syncError extension
conflictingTempId string TempId for the conflicting entity
desc string Error description or the conflict resolution
isConflict bool Denotes if its an errorElement or conflict. Used only when is not null
emitMetadataOnly bool Bool flag that denotes whether a partial metadata only entity is to be written
return void