Understanding attachment sync results

Complexity: Beginner Data Requirement: ArcGIS Tutorial Data for Desktop

Understanding attachment sync results

When yousynchronize attachments using a FeatureAttachmentSyncAgent, a summary of a synchronization results return as a FeatureAttachmentSyncResults object. This topic discusses how to obtain the FeatureAttachmentSyncResults, and you will learn about the properties. To learn about the attachment upload and download processes, read Uploading attachments and Synchronizing attachments.

//Cast the sync results to be FeatureAttachmentSyncResults.
FeatureAttachmentSyncResults results = 
  featureAttachmentSyncAgent.Synchronize() as FeatureAttachmentSyncResults;

You can also obtain a FeatureAttachmentSyncResults object as a property of FeatureSyncAgent, after the features download. Also recall, that you can set the FeatureSyncAgent.SynchronizeAttachments property to false so that it skips downloading attachments; in this situation, the FeatureSyncAgent is null.

//First prepare a FeatureSource and a MapDocumentConnection object.
//Then use them to create a FeatureSyncAgent object.
FeatureSyncAgent featureSyncAgent = new FeatureSyncAgent(featureSource, mapDocumentConnection);

//Using the default settings, you synchronize features with their attachments.
featureSyncAgent.Synchronize();

//Then you will obtain the FeatureAttachmentSyncResults. Note that a casting is not necessary.
FeatureAttachmentSyncResults results = featureSyncAgent.AttachmentSyncResults;

A FeatureAttachmentSyncResults object has the following properties:

1/7/2015