Detailed Introduction to Custom nodes

Source: Internet
Author: User
In. NET, because a different node corresponds to a class to handle it. NET inside for convenience, has built up some classes for us to use, so that when we read the configuration file, we do not have to define the class to handle their own defined custom nodes. Below we have written a configuration file: <?xml version= "1.0" encoding= "Utf-8"?><configuration> <configSections> <!-- Use ignoresection to handle custom nodes-<!--<section name= "mailserveraddress" &

1.. net--using. Net built-in handlers to handle custom nodes demo

Summary: In. NET, because of the different nodes, the corresponding class to handle it,. NET inside for convenience, has built up some classes for us to use, so that when we read the configuration file, we do not have to define the class to handle their own defined custom nodes. Here we write a configuration file:--the node name is: MailServe

2.. net--implements the IConfigurationSectionHandler interface definition handler to handle the custom node

Summary: In addition to using the built-in handlers provided in. NET to handle our custom nodes, we can also use a variety of methods to define processing classes to handle our custom nodes, this article mainly introduces the way to implement a custom handler by implementing the IConfigurationSectionHandler interface. First, let's write the following custom node in the config file: 13232@qq.com LHC

3.. Net configuration file--Inherit configurationsection implement custom processing class handle custom Configuration node

Summary: In addition to using inherited IConfigurationSectionHandler methods to define classes that handle custom nodes, you can also achieve the same effect by inheriting the ConfigurationSection class. First of all. NET configuration file: When you configure a node, there are two ways to store the parameter data: one that is stored in the attributes of the node, and the other stored in the text of the node. Because a node can have a lot

4.. NET configuration file--Unified node configuration management

Introduction: For. NET, if you want to handle it separately, add a specified class for this node, and if we define many custom nodes in an application, then by doing so, there will be a lot more processing classes, in order to avoid too many classes, We specify a custom node as a portal for all custom nodes, and then write only one processing class, which is the portal and reads the other nodes.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.