public AnimationGroupElement ConvertToGroup(AnimationSingleElement singleAnimationElement) { AnimationElements.Remove(singleAnimationElement); AnimationGroupElement convertedGroup = AnimationGroupElement.Parse(singleAnimationElement); AnimationElements.Add(convertedGroup); return(convertedGroup); }
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); }
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); }
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); }