public virtual void CopyFrom(ItemConfiguration configuration)
        {
            ItemConfiguration other = (ItemConfiguration)configuration;

            if (other.properties != null)
            {
                properties = new Hashtable();
                foreach (DictionaryEntry e in other.properties)
                {
                    if (e.Value is ICloneable)
                    {
                        properties [e.Key] = ((ICloneable)e.Value).Clone();
                    }
                    else
                    {
                        properties [e.Key] = e.Value;
                    }
                }
            }
            else
            {
                properties = null;
            }
            customCommands = other.customCommands.Clone();
        }
Example #2
0
        public CustomCommandCollection Clone()
        {
            CustomCommandCollection col = new CustomCommandCollection();

            col.CopyFrom(this);
            return(col);
        }
Example #3
0
 public void CopyFrom(CustomCommandCollection col)
 {
     Clear();
     foreach (CustomCommand cmd in col)
     {
         Add(cmd.Clone());
     }
 }
Example #4
0
 protected virtual void OnCopyFrom(ItemConfiguration configuration, bool isRename)
 {
     if (configuration.properties != null)
     {
         properties = new Hashtable();
         foreach (DictionaryEntry e in configuration.properties)
         {
             if (e.Value is ICloneable)
             {
                 properties [e.Key] = ((ICloneable)e.Value).Clone();
             }
             else
             {
                 properties [e.Key] = e.Value;
             }
         }
     }
     else
     {
         properties = null;
     }
     customCommands = configuration.customCommands.Clone();
 }