Welcome to MSDN Blogs Sign in | Join | Help

Syndication

Tags

    No tags have been created or used yet.
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);

            }

      }

}

 

 

 

Published Thursday, August 17, 2006 11:13 AM by kumar vinod

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 RSS

Comments

# re: How to Enumerate Global Resource Properties. @ Monday, August 21, 2006 8:09 PM

Any issues with Disposing the object or will the GC take care of that?

Erl Egestad

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
Page view tracker