T CacheAndInitializeShape <T>(Wd.CompositionShape source, T target) where T : Wc.CompositionShape { CacheAndInitializeCompositionObject(source, target); if (source.CenterPoint.HasValue) { target.CenterPoint = source.CenterPoint.Value; } if (source.Offset.HasValue) { target.Offset = source.Offset.Value; } if (source.RotationAngleInDegrees.HasValue) { target.RotationAngleInDegrees = source.RotationAngleInDegrees.Value; } if (source.Scale.HasValue) { target.Scale = source.Scale.Value; } if (source.TransformMatrix.HasValue) { target.TransformMatrix = source.TransformMatrix.Value; } return(target); }
Wc.CompositionShape GetCompositionShape(Wd.CompositionShape obj) { switch (obj.Type) { case Wd.CompositionObjectType.CompositionSpriteShape: return(GetCompositionSpriteShape((Wd.CompositionSpriteShape)obj)); case Wd.CompositionObjectType.CompositionContainerShape: return(GetCompositionContainerShape((Wd.CompositionContainerShape)obj)); default: throw new InvalidOperationException(); } }