NameValueSectionHandler usage

  • Thread starter Thread starter Mike Bird
  • Start date Start date
M

Mike Bird

I am trying to create a NameValueSectionHandler to read a section from an
XML file. I am trying to figure out what parameters to pass to the Create
method. Parameter 1 is simply described as an object. I can't figure out
what type of object to pass in.

I assumed it would be a NameValueCollection, the same as the return, but
that isn't it. I also tried a Hashtable. All I can get to work is a null,
anything else generates an invalid type-cast exception.

I have searched the help, MSDN, and did a Google search for a sample but
can't find any samples of directly using his class. Can anyone show me a
working sample, or point me to one?

Thanks
 
Mike,
You can pass null to the first two parameters of the Create method. The third parameter is the XmlNode that holds the config section.

Tu-Thach

----- Mike Bird wrote: -----

I am trying to create a NameValueSectionHandler to read a section from an
XML file. I am trying to figure out what parameters to pass to the Create
method. Parameter 1 is simply described as an object. I can't figure out
what type of object to pass in.

I assumed it would be a NameValueCollection, the same as the return, but
that isn't it. I also tried a Hashtable. All I can get to work is a null,
anything else generates an invalid type-cast exception.

I have searched the help, MSDN, and did a Google search for a sample but
can't find any samples of directly using his class. Can anyone show me a
working sample, or point me to one?

Thanks
 
Mike said:
I am trying to figure out what parameters to pass to the Create method.

Create is invoked by the Framework, not you. The third parameter is the
actual XmlNode that contains your section. Process that.

--
There are 10 kinds of people. Those who understand binary and those who
don't.

http://code.acadx.com
(Pull the pin to reply)
 
Back
Top