예제 #1
0
        /// <summary>
        ///     Clones this instance.
        /// </summary>
        /// <returns>A duplicated rule.</returns>
        public Rule Clone()
        {
            var ret = new Rule
            {
                Preset  = Preset,
                Pattern = Pattern,
                Inherit = Inherit
            };

            foreach (var i in this)
            {
                var item = new SettingItem <Protection>
                {
                    Id     = i.Id,
                    Action = i.Action
                };
                foreach (var j in i.Keys)
                {
                    item.Add(j, i[j]);
                }

                ret.Add(item);
            }
            return(ret);
        }
예제 #2
0
        /// <summary>
        ///     Clones this instance.
        /// </summary>
        /// <returns>A duplicated setting item.</returns>
        public SettingItem <T> Clone()
        {
            var item = new SettingItem <T>(Id, Action);

            foreach (var entry in this)
            {
                item.Add(entry.Key, entry.Value);
            }
            return(item);
        }
예제 #3
0
        /// <summary>
        ///     Clones this instance.
        /// </summary>
        /// <returns>A duplicated rule.</returns>
        public Rule Clone()
        {
            var ret = new Rule();

            ret.Preset  = Preset;
            ret.Pattern = Pattern;
            ret.Inherit = Inherit;
            foreach (var i in this)
            {
                var item = new SettingItem <Protection>();
                item.Id     = i.Id;
                item.Action = i.Action;
                foreach (string j in i.Keys)
                {
                    item.Add(j, i[j]);
                }
                ret.Add(item);
            }
            return(ret);
        }
예제 #4
0
        public Rule Clone()
        {
            Rule ret = new Rule();

            ret.Preset  = this.Preset;
            ret.Pattern = this.Pattern;
            ret.Inherit = this.Inherit;
            foreach (var i in this)
            {
                var item = new SettingItem <IConfusion>();
                item.Id     = i.Id;
                item.Action = i.Action;
                foreach (var j in i.AllKeys)
                {
                    item.Add(j, i[j]);
                }
                ret.Add(item);
            }
            return(ret);
        }