[ConfigurationProperty("CusMapSetting")]
        public CustomMapCfgElement CusMapSetting
        {
            get { return (CustomMapCfgElement)this["CusMapSetting"]; }
            set { this["CusMapSetting"] = value; }
        }
这段代码是什么意思啊

解决方案 »

  1.   

    CusMapSetting一个属性,类型是CustomMapCfgElement。从名称上也差不多可以猜出是一个key value的数据
      

  2.   

    [...]
    这个叫attribute你可以定位到ConfigurationProperty,CustomMapCfgElement等,然后右键,转到定义看它究竟是什么。
      

  3.   

    1.[ConfigurationProperty("CusMapSetting")] 自定义属性,供实例化对象或派生类反射使用,
    比如实例化后反射查询这个CusMapSetting 属性有没有有的话做相应的选择如:
    作不个不十分恰当的比喻
    if(typeof(myclas).GetProperty("CusMapSetting").IsDefined(typeof(ConfigurationPropertyAttribute), false))
    {//myclas的属性(Property)CusMapSetting,应用了ConfigurationPropertyAttribute这个属性(Attribute)}
    2.
    public CustomMapCfgElement CusMapSetting         {             get { return (CustomMapCfgElement)this["CusMapSetting"]; }             set { this["CusMapSetting"] = value; }         }
    CusMapSetting 属性(Property) 取本实例化的类的CusMapSetting时取得 字符串索引器的值总结本例使用了自定义属性 字符串索引器 类的属性 还有就是 反射的使用,只要搞清这三方面这个例子就理解了