Example #1
0
        /// <summary>
        /// 创建配置节实例
        /// </summary>
        /// <param name="setting">被复制的配置节</param>
        /// <param name="deep">是否深度复制</param>
        /// <returns>配置节</returns>
        protected virtual ConfigSetting CreateConfigSetting(ConfigSetting setting, bool deep)
        {
            var newSetting = this.CreateConfigSetting();

            newSetting.@readonly   = setting.ReadOnly;
            newSetting.settingName = setting.settingName;
            if (deep)
            {
                newSetting.value            = setting.Value.Clone();
                newSetting.property         = setting.Property.Clone(this.@readonly, true);
                newSetting.childSettings    = setting.childSettings.Clone(newSetting);
                newSetting.operatorSettings = setting.operatorSettings.Clone(newSetting);
            }
            else
            {
                newSetting.value            = setting.Value;
                newSetting.property         = setting.Property;
                newSetting.childSettings    = setting.childSettings;
                newSetting.operatorSettings = setting.operatorSettings;
            }
            return(newSetting);
        }