Beispiel #1
0
        /// <summary>
        /// 克隆选项属性
        /// </summary>
        /// <param name="readonly">是否只读</param>
        /// <param name="deep">是否深度复制</param>
        /// <returns>OptionProperty</returns>
        public virtual OptionSection Clone(bool @readonly, bool deep)
        {
            OptionSection property = this.CreateOptionSection(@readonly);

            if (deep)
            {
                foreach (OptionValue settingValue in this._optionValues.Values)
                {
                    property._optionValues.Add(settingValue.Clone(@readonly));
                }
            }
            else
            {
                property._optionValues = this._optionValues;
            }
            return(property);
        }
Beispiel #2
0
        internal virtual OptionSection Merge(OptionSection property)
        {
            foreach (string key in property._optionValues.Keys)
            {
                switch (key)
                {
                case Option.OptionFilePropertyName:
                case Option.OptionNodePropertyName:
                    break;

                default:
                    this._optionValues.Set(property[key].Clone());
                    break;
                }
            }
            return(this);
        }