Exemplo n.º 1
0
        public ComponentInfo Copy()
        {
            List <HelperRectangle> newRectangles = new List <HelperRectangle>();

            foreach (HelperRectangle rect in HelperRectangles)
            {
                newRectangles.Add(rect.Copy());
            }

            Dictionary <string, ComponentProperty> newProperties = new Dictionary <string, ComponentProperty>();

            foreach (KeyValuePair <string, ComponentProperty> pair in Properties)
            {
                newProperties.Add((string)pair.Key.Clone(), pair.Value.Copy());
            }

            var newComponent = new ComponentInfo((string)RealName.Clone(), (string)ClassName.Clone(), DefaultAnimation.Copy(), (string)AnimationProperty.Clone(), newRectangles, newProperties);

            newComponent.SetAnimKey        = (string)SetAnimKey.Clone();
            newComponent._CurrentAnimation = _CurrentAnimation;

            return(newComponent);
        }