public void CopyFrom(IAppleConverterePub2Settings appleConverterSettings) { if (appleConverterSettings == null) { throw new ArgumentNullException("appleConverterSettings"); } if (appleConverterSettings == this) { return; } _platforms.Clear(); foreach (var platform in appleConverterSettings.Platforms) { AppleEPub2PlatformSettings platformTo = new AppleEPub2PlatformSettings(); platformTo.CopyFrom(platform); _platforms.Add(platformTo); } }
internal void SetSettings(IAppleConverterePub2Settings appleConverterePub2Settings) { _platforms.Clear(); foreach (var platform in appleConverterePub2Settings.Platforms) { var targetPlatform = new AppleTargetPlatform(); switch (platform.Name) { case EPubLibraryContracts.Settings.AppleTargetPlatform.All: targetPlatform.Type = PlatformType.All; break; case EPubLibraryContracts.Settings.AppleTargetPlatform.iPad: targetPlatform.Type = PlatformType.iPad; break; case EPubLibraryContracts.Settings.AppleTargetPlatform.iPhone: targetPlatform.Type = PlatformType.iPhone; break; case EPubLibraryContracts.Settings.AppleTargetPlatform.NotSet: // we not going to add if type not set Logger.Log.Error("SetupAppleSettings() - passed apple platform of type NotSet"); continue; } targetPlatform.FixedLayout = platform.FixedLayout; targetPlatform.OpenToSpread = platform.OpenToSpread; targetPlatform.CustomFontsAllowed = platform.UseCustomFonts; switch (platform.OrientationLock) { case AppleOrientationLock.None: targetPlatform.OrientationLockType = OrientationLock.Off; break; case AppleOrientationLock.LandscapeOnly: targetPlatform.OrientationLockType = OrientationLock.LandscapeOnly; break; case AppleOrientationLock.PortraitOnly: targetPlatform.OrientationLockType = OrientationLock.PortraitOnly; break; } AddPlatform(targetPlatform); } }