This document is archived and information here might be outdated.  Recommended version.


IMetadata.Synchronize Method (ArcObjects .NET 10.4 SDK)
ArcObjects Library Reference (GeoDatabase)  

IMetadata.Synchronize Method

Updates metadata with the current properties; may create metadata if it doesn't already exist.

[Visual Basic .NET]
Public Sub Synchronize ( _
    ByVal action As esriMetadataSyncAction, _
    ByVal interval As Integer _
)
[C#]
public void Synchronize (
    esriMetadataSyncAction action,
    int interval
);
[C++]
HRESULT Synchronize(
  esriMetadataSyncAction action,
  long interval
);
[C++]

Parameters action [in]
action is a parameter of type esriMetadataSyncAction interval [in] interval is a parameter of type long

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Description

The Synchronize method is used to extract metadata properties from an object and write those properties to the metadata .xml. Depending on the value of the esriMetaSyncAction, the Synchronize method may generate a new set of metadata if it doesn't already exist.

Errors Returned

This method cannot be used if the underlying object is a data element (i.e. DETable, DEFeatureClass).

Remarks

The following actions will result in synchronization given each of the listed conditions:

Action Metadata status Esri/Sync element Interval parameter
esriMSAAccessed Doesn't matter Must not be FALSE Must be less than actual interval
esriMSAAlways Doesn't matter Doesn't matter Doesn't matter
esriMSACreated Must not exist Must not be FALSE Must be less than actual interval
esriMSANotCreated Must exist Must not be FALSE Must be less than actual interval
esriMSAOverwrite Doesn't matter Doesn't matter Doesn't matter

The difference between esriMSAAlways and esriMSAOverwrite lies in which elements are synchronized. esriMSAAlways will honor the removal or value change of an element's Sync attribute (to disable synchronization), whereas using esriMSAOverwrite is equivalent to setting the IXmlPropertySet2.OverwriteSyncAttribute to true for the metadata's property set, meaning that even elements without a Sync attribute of TRUE will be synchronized.

See Also

IMetadata Interface