public void SetupDefaults()
 {
     _platforms.Clear();
     var platform = new AppleEPub2PlatformSettings { Name = AppleTargetPlatform.All, 
                                                         UseCustomFonts = true, 
                                                         OpenToSpread = false, 
                                                         OrientationLock = AppleOrientationLock.None,
                                                         FixedLayout = false};
     _platforms.Add(platform);
 }
 /// <summary>
 /// Saves current state to settings
 /// </summary>
 /// <param name="settings"></param>
 public override void SaveToSettings(IConverterSettings settings)
 {
     settings.V2Settings.AppleConverterEPubSettings.Platforms.Clear();
     foreach (var platform in _used.Values)
     {
         var createdSettings = new AppleEPub2PlatformSettings();
         createdSettings.CopyFrom(platform);
         settings.V2Settings.AppleConverterEPubSettings.Platforms.Add(createdSettings);
     }
     base.SaveToSettings(settings);
 }
        public void SetupDefaults()
        {
            _platforms.Clear();
            var platform = new AppleEPub2PlatformSettings {
                Name            = AppleTargetPlatform.All,
                UseCustomFonts  = true,
                OpenToSpread    = false,
                OrientationLock = AppleOrientationLock.None,
                FixedLayout     = false
            };

            _platforms.Add(platform);
        }
 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);
     }
 }
 private void ReadPlatforms(XmlReader reader)
 {
     _platforms.Clear();
     while (reader.Read())
     {
         if (reader.NodeType == XmlNodeType.Element)
         {
             switch (reader.Name)
             {
             case AppleEPub2PlatformSettings.PlatformElementName:
                 var platformSettings = new AppleEPub2PlatformSettings();
                 platformSettings.ReadXml(reader.ReadSubtree());
                 _platforms.Add(platformSettings);
                 break;
             }
         }
     }
 }
 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);
     }
 }
 /// <summary>
 /// Update display of currently selected platform settings based on platform object passed
 /// </summary>
 /// <param name="selectedPlatform"></param>
 private void DisplayPlatformSettings(AppleEPub2PlatformSettings selectedPlatform)
 {
     bool displayEnabled = _selectedListBox == SelectedBox.Used && selectedPlatform != null;
     checkBoxFixedLayout.Enabled = displayEnabled;
     checkBoxSpreadToOpen.Enabled = displayEnabled;
     checkBoxUseCustomFonts.Enabled = displayEnabled;
     comboBoxOrientationLock.Enabled = displayEnabled;
     if (displayEnabled)
     {
         checkBoxFixedLayout.Checked = selectedPlatform.FixedLayout;
         checkBoxSpreadToOpen.Checked = selectedPlatform.OpenToSpread;
         checkBoxUseCustomFonts.Checked = selectedPlatform.UseCustomFonts;
         comboBoxOrientationLock.SelectedIndex = (int)selectedPlatform.OrientationLock;
     }
     else
     {
         checkBoxFixedLayout.Checked = false;
         checkBoxSpreadToOpen.Checked= false;
         checkBoxUseCustomFonts.Checked = false;
         comboBoxOrientationLock.SelectedIndex = -1;
     }
 }
 private void ReadPlatforms(XmlReader reader)
 {
     _platforms.Clear();
     while (reader.Read())
     {
         if (reader.NodeType == XmlNodeType.Element)
         {
             switch (reader.Name)
             {
                 case AppleEPub2PlatformSettings.PlatformElementName:
                     var platformSettings = new AppleEPub2PlatformSettings();
                     platformSettings.ReadXml(reader.ReadSubtree());
                     _platforms.Add(platformSettings);
                     break;
             }
         }
     }            
 }