Example #1
0
        public AnimationGroupElement ConvertToGroup(AnimationSingleElement singleAnimationElement)
        {
            AnimationElements.Remove(singleAnimationElement);
            AnimationGroupElement convertedGroup = AnimationGroupElement.Parse(singleAnimationElement);

            AnimationElements.Add(convertedGroup);

            return(convertedGroup);
        }
Example #2
0
        public static AnimationGroupElement Parse(AnimationSingleElement singleAnimationElement)
        {
            var convertedGroup = new AnimationGroupElement();

            convertedGroup.Name       = singleAnimationElement.Name;
            convertedGroup.Placement  = singleAnimationElement.Placement;
            convertedGroup.Prediction = singleAnimationElement.Prediction;
            convertedGroup.Route      = singleAnimationElement.Route;
            convertedGroup.Elements   = new List <IAnimationElement>();

            return(convertedGroup);
        }
Example #3
0
        public IAnimationElement SearchParentAnimationElement(IAnimationElement singleAnimationElement)
        {
            foreach (var AnimationElement in AnimationElements)
            {
                if (AnimationElement is AnimationGroupElement)
                {
                    var group = AnimationElement as AnimationGroupElement;

                    AnimationGroupElement result = group.SearchParentAnimationElement(singleAnimationElement);
                    if (result != null)
                    {
                        return(result);
                    }
                }
            }
            return(null);
        }
Example #4
0
        public AnimationGroupElement SearchParentAnimationElement(IAnimationElement singleAnimationElement)
        {
            foreach (var element in Elements)
            {
                if (Elements.Contains(singleAnimationElement))
                {
                    return(this);
                }

                if (element is AnimationGroupElement)
                {
                    var group = element as AnimationGroupElement;

                    AnimationGroupElement result = group.SearchParentAnimationElement(singleAnimationElement);
                    if (result != null)
                    {
                        return(result);
                    }
                }
            }
            return(null);
        }