Exemplo n.º 1
0
        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();
        }
Exemplo n.º 2
0
        public CustomCommandCollection Clone()
        {
            CustomCommandCollection col = new CustomCommandCollection();

            col.CopyFrom(this);
            return(col);
        }
Exemplo n.º 3
0
 public void CopyFrom(CustomCommandCollection col)
 {
     Clear();
     foreach (CustomCommand cmd in col)
     {
         Add(cmd.Clone());
     }
 }
Exemplo n.º 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();
 }