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


IXmlPropertySet.SetPropertyX Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (GeoDatabase)  

IXmlPropertySet.SetPropertyX Method

Sets the value of the specified element.

[Visual Basic .NET]
Public Sub SetPropertyX ( _
    ByVal Name As String, _
    ByVal Value As Object, _
    ByVal propType As esriXmlPropertyType, _
    ByVal action As esriXmlSetPropertyAction, _
    ByVal syncing As Boolean _
)
[C#]
public void SetPropertyX (
    string Name,
    object Value,
    esriXmlPropertyType propType,
    esriXmlSetPropertyAction action,
    bool syncing
);
[C++]
HRESULT SetPropertyX(
  BSTR Name,
  VARIANT Value,
  esriXmlPropertyType propType,
  esriXmlSetPropertyAction action,
  VARIANT_BOOL syncing
);
[C++]

Parameters Name [in] Name is a parameter of type BSTR Value [in] Value is a parameter of type VARIANT propType [in]
propType is a parameter of type esriXmlPropertyType action [in]
action is a parameter of type esriXmlSetPropertyAction syncing syncing is a parameter of type VARIANT_BOOL

Product Availability

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

Description

The SetPropertyX method uses uses XPath to specify metadata elements. The method then adds or replaces the element value. 

Remarks

The Name parameter uses XPath to specify metadata elements. Additional information on XPath can be found in the IXmlPropertySet documentation. The Value parameter is the property the will be set to.

The propType parameter is a required esriXmlPropertyType constant. By selecting the constant, the type of data stored within the metadata element (normal text, generic binary enclosures, images, links, picture object, binary enclosures containing an image) is set.

The Action parameter is a esriXmlSetPropertyAction constant. These constants allows several options when encountering different scenarios in metadata. The esriXmlSetPropertyAction constants work differently depending on the presence/absence of the XML element. It is important to be familiar with the different actions. For instance, if the Name expression fails to located the specified XML element, all esriXmlSetPropertyAction constants (except esriXSPAReplaceIfExists) will add the XML element. The table below better explains the action constants:

Action Constant Element Exists Element Does Not Exist
esriXSPAAddOrReplace Replaces element Adds a new element
esriXSPAAddIfNotExists Nothing happens Adds a new element
esriXSPAReplaceIfExists Replaces element Nothing happens
esriXSPAAddDuplicate Adds an additional element Adds a new element

The Boolean syncing parameter provides an additional degree of control when creating or modifying an element. The parameter indicates whether or not synchronization is taking place. The parameter's setting can override the action parameter. When creating a new element, if the parameter is true, the element is given a Sync attribute with a value of "TRUE". When modifying an existing element, if the syncing parameter is false the element is always modified, and if it has a Sync attribute, the attribute is removed. If the syncing parameter is true when modifying an element, the element's Sync attribute is first inspected; if it has a value of "TRUE", modification occurs, but if it has another value (or no Sync attribute) the modification will not occur.

More information can be found in the white paper "Synchronization in ArcCatalog" May. 2001.

See Also

IXmlPropertySet Interface | esriXmlPropertyType Constants | esriXmlSetPropertyAction Constants