RcBuilder@walla.com
call centre: 054-5614020

Custom Config Section

Posted by: RcBuilder  /   Category: configuration / Custom section / SOURCE CODE / StringBuilder   /   No Comments
09
Nov
2014

Custom Config Section web.config <configuration> <configSections> <section name="MySectionConfig" type="MySectionClass" /> </configSections> <MySectionConfig> <E1>ELEMENT 1</E1> <E2>ELEMENT 2</E2> <E3 A1="ATTRIBUTE 1" A2="ATTRIBUTE 2" A3="ATTRIBUTE 3" /> <G1> <add name="Name1" value="Value1" /> <add name="Name2" value="Value2" /> <add name="Name3" value="Value3" /> </G1> </MySectionConfig> </configuration> MySectionClass using System; using System.Configuration; using System.Text; public class MySectionClass : ConfigurationSection { public E e1 { get { return (E)this; } } public E e2 { get { return (E)this; } } public E3 e3 { get { return.

Read more

web config custom section group

Posted by: RcBuilder  /   Category: configuration / Custom section / Serialize / XML   /   No Comments
05
Oct
2014

web config custom section group WEB.CONFIG  <configuration> <configSections> <section name="MTGroups" type="ConfigSections.MTGroups" /> </configSections> <MTGroups> <add name="Name1" value="Value1" /> <add name="Name2" value="Value2" /> <add name="Name3" value="Value3" /> </MTGroups> </configuration> SERIALIZATION  using System.Configuration; namespace ConfigSections { public class MTGroups : ConfigurationSection{ public Group keys { get { return (Group)this; } } } public class Group : ConfigurationElementCollection{ protected override ConfigurationElement CreateNewElement() { return new Key(); } protected override object GetElementKey(ConfigurationElement element) { return ((Key)element).name; } } public class Key : ConfigurationElement{ public string name { get {.

Read more

custom config section example

Posted by: RcBuilder  /   Category: configuration / Custom section / IEnumerable / Serialize / XML   /   No Comments
01
Oct
2014

custom config section example namespace ConfigSections // this class should define the xml structure of your custom config section in order to get the // ability to deSerialize it public class MTGroups : ConfigurationSection, IEnumerable<MTGroups.Key> { public MTGroups.Group keys { get { return (MTGroups.Group)this; } } public IEnumerator<MTGroups.Key> GetEnumerator() { foreach (MTGroups.Key k in this.keys) yield return k; } IEnumerator IEnumerable.GetEnumerator() { throw new NotImplementedException(); } public class Group : ConfigurationElementCollection { protected.

Read more
  • פיתוח מערכות
  • פתרונות טכנולוגים
  • קידום אתרים
  • בניית אתרים