Interface IPropertySet
- Namespace
- ESRI.ArcGIS.esriSystem
- Assembly
- ESRI.Server.System.dll
Provides access to members for managing a PropertySet.
[Guid("F0BA6ABC-8E9F-11D0-B4AB-0000F8037368")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IPropertySet
Remarks
PropertySet is a generic class that is used to hold a set of properties for anything. One example for the use of a property set is to hold the properties required for opening up an SDE workspace as is shown in the example code.
Typically a property set can be thought of as a set of keys (strings) and values (variants/objects). One notable exception to this is when using the IPropertySet interface on an XmlPropertySet object. An XML document can contain multiple elements with the same name (i.e. "property/child") and different values. Because of this, the values returned by this interface from an XmlPropertySet may be jagged two-dimensional arrays (arrays containing other arrays). See the XmlPropertySet coclass' documentation in the Geodatabase library for more details and code examples.
public Object GetServerProperty(string propertyName)
{
Type envMgrType = Type.GetTypeFromProgID("esriSystem.EnvironmentManager");
object envMgrObj = Activator.CreateInstance(envMgrType);
IEnvironmentManager envMgr = envMgrObj as IEnvironmentManager;
UID envUID = new UIDClass();
envUID.Value = "{32D4C328-E473-4615-922C-63C108F55E60}";
IServerEnvironment2 serverEnvironment = (IServerEnvironment2)envMgr.GetEnvironment(envUID);
IPropertySet serverProps = serverEnvironment.Properties;
object propertyValue = serverProps.GetProperty(propertyName);
return propertyValue;
}
Properties
Count
The number of properties contained in the property set.
int Count { get; }
Property Value
Remarks
The Count value will always be one when used with the esriGeodatabase.XmlPropertySet coclass. For more information, see the remarks for the XmlPropertySet coclass.
Methods
GetAllProperties(out object, out object)
The name and value of all the properties in the property set.
void GetAllProperties(out object names, out object values)
Parameters
Remarks
The GetAllProperties retrieves all names and values in the property set.
GetProperties(object, out object)
The values of the specified properties.
void GetProperties(object names, out object values)
Parameters
Remarks
The GetProperties method returns values from a PropertySet CoClass.
public Object GetServerProperty(IServerEnvironment3 server, string propertyName="ExtensionName")
{
Object propertyValue = null;
IPropertySet serverProps = server.Properties;
propertyValue = serverProps.GetProperty(propertyName);
return propertyValue;
}
GetProperty(string)
The value of the specified property.
object GetProperty(string Name)
Parameters
Namestring
Returns
IsEqual(IPropertySet)
True if the property set is the same as the input property set.
bool IsEqual(IPropertySet PropertySet)
Parameters
PropertySetIPropertySet
Returns
Remarks
This method indicates whether two property sets are equal.
Note that it will always return false if the property set is an esriGeodatabase.XmlPropertySet (for metadata). See the XmlPropertySet coclass' documentation for more information.
RemoveProperty(string)
Removes a property from the set.
void RemoveProperty(string Name)
Parameters
Namestring
SetProperties(object, object)
The values of the specified properties.
void SetProperties(object names, object values)
Parameters
Remarks
Using the Name parameter to locate the specified element, the SetProperties method populates the elements, or adds an new element if it already exists, and sets the value to the coorseponding Values parameter.
The Name parameter uses XSL Patterns to specify metadata elements. Additional information on XSL can be found in the the IXmlPropertySet documentation.
esriXmlSetPropertyAction constants are NOT available to handle situations where an element value already exists. Upon encountering elements that already have values, the new values will replace or add values to existing elements. For more control dealing with elements the IXmlPropertySet::SetPropertyX should be used.
In order to populated nodes further along in the Xml tree, nodes necessary to navigate must first be established. For instance in order to populate the "idinfo/ptcontact/cntinfo/cntperp/cntorg" node each subsequent nodes, "idinfo", "idinfo/ptcontact", "idinfo/ptcontact/cntinfo" and "idinfo/ptcontact/cntinfo/cntperp" must already be in place.
SetProperty(string, object)
The value of the specified property.
void SetProperty(string Name, object Value)
Parameters
Remarks
The Name parameter uses XSL Patterns to specify metadata elements. Additional information on XSL can be found in the the IXmlPropertySet documentation.