private static PocoFrameImage ToPoco(this IFrameImage source, ConversionContext context) { if (source == null) return null; var poco = source as PocoFrameImage; if ((poco != null) || context.GetOrCreate(source, () => new PocoFrameImage(), out poco)) return poco; source.CopyTo(poco, nameof(IFrameImage.FrameItemImage)); return poco; }
private static PocoFrameText ToPoco(this IFrameText source, ConversionContext context) { if (source == null) return null; var poco = source as PocoFrameText; if ((poco != null) || context.GetOrCreate(source, () => new PocoFrameText(), out poco)) return poco; source.CopyTo(poco); return poco; }
private static PocoFrameVideo ToPoco(this IFrameVideo source, ConversionContext context) { if (source == null) return null; var poco = source as PocoFrameVideo; if ((poco != null) || context.GetOrCreate(source, () => new PocoFrameVideo(), out poco)) return poco; source.CopyTo(poco, nameof(IFrameVideo.FrameItemVideoFilePath)); return poco; }
private static PocoFrameRingEntry ToPoco(this IFrameRingEntry source, ConversionContext context) { if (source == null) return null; var poco = source as PocoFrameRingEntry; if ((poco != null) || context.GetOrCreate(source, () => new PocoFrameRingEntry(), out poco)) return poco; source.CopyTo(poco, nameof(IFrameRingEntry.RingEntryFrame)); poco.RingEntryFrame = source.RingEntryFrame.ToPoco(context); return poco; }
private static PocoFrameRing ToPoco(this IFrameRing source, ConversionContext context) { if (source == null) return null; var poco = source as PocoFrameRing; if ((poco != null) || context.GetOrCreate(source, () => new PocoFrameRing(), out poco)) return poco; source.CopyTo(poco, nameof(IFrameRing.RingItems)); poco.PocoRingItems = source.RingItems.Select(entry => ToPoco(entry, context)).ToList(); return poco; }
private static PocoAudioRingEntry ToPoco(this IAudioRingEntry source, ConversionContext context) { var poco = source as PocoAudioRingEntry; if ((poco != null) || context.GetOrCreate(source, () => new PocoAudioRingEntry(), out poco)) { return(poco); } source.CopyTo(poco, nameof(IAudioRingEntry.AudioFiles), nameof(IAudioRingEntry.AudioIds)); poco.AudioGuidList = source.AudioIds.ToList(); return(poco); }
private static PocoAudioRing ToPoco(this IAudioRing source, ConversionContext context) { var poco = source as PocoAudioRing; if ((poco != null) || context.GetOrCreate(source, () => new PocoAudioRing(), out poco)) { return(poco); } source.CopyTo(poco, nameof(IAudioRing.RingItems)); poco.PocoRingItems = source.RingItems.Select(entry => ToPoco(entry, context)).ToList(); return(poco); }
private static PocoFrame ToPoco(this IFrame source, ConversionContext context) { if (source == null) return null; var poco = source as PocoFrame; if ((poco != null) || context.GetOrCreate(source, () => new PocoFrame(), out poco)) return poco; source.CopyTo(poco, nameof(IFrame.FrameChildren), nameof(IFrame.FrameTransitions)); foreach (IFrameItem child in source.FrameChildren) if (child is IFrameText) poco.Texts.Add(child as PocoFrameText ?? ((IFrameText) child).ToPoco(context)); else if (child is IFrameImage) poco.Images.Add(child as PocoFrameImage ?? ((IFrameImage) child).ToPoco(context)); else if (child is IFrameVideo) poco.Videos.Add(child as PocoFrameVideo ?? ((IFrameVideo) child).ToPoco(context)); else if (child is IFrame) poco.Frames.Add(child as PocoFrame ?? ((IFrame) child).ToPoco(context)); return poco; }