How to Enumerate Global Resource Properties.
I got few questions around how to enumerate the properties for a global resource. So here is how you do it. Following sample spits the properties for all the global resources in the console window. This sample uses the manager version of the globalconfig object. The APIs in this object return the ADO RecordSets. SO we'll need to enumerate through the Fields collecitons.
GlobalConfig2FreeThreaded config = new GlobalConfig2FreeThreaded();
config.Initialize("");
Fields globalResources = config.Fields;
foreach (Field globalResource in globalResources)
{
_Recordset globalResourceProperties = globalResource.Value as _Recordset;
if (globalResourceProperties != null)
{
foreach (Field property in globalResourceProperties.Fields)
{
Console.WriteLine("{0} = {1}", property.Name, property.Value);
}
}
}
Comment Notification
If you would like to receive an email when updates are made to this post, please register here
Subscribe to this post's comments using