Пример #1
0
 public void CopyFrom(IEPubV3Settings temp)
 {
     _v3SubStandard           = temp.V3SubStandard;
     _generateV2CompatibleTOC = temp.GenerateV2CompatibleTOC;
     FootnotesCreationMode    = temp.FootnotesCreationMode;
     HTMLFileMaxSize          = temp.HTMLFileMaxSize;
 }
Пример #2
0
        public void ReadXml(XmlReader reader)
        {
            while (!reader.EOF)
            {
                if (reader.IsStartElement())
                {
                    switch (reader.Name)
                    {
                    case EPUB3SubVersionElementName:
                        EPubV3SubStandard standard;
                        string            elementContent = reader.ReadElementContentAsString();
                        if (!Enum.TryParse(elementContent, true, out standard))
                        {
                            throw new InvalidDataException(string.Format("Invalid epub standard version passed : {0}", elementContent));
                        }
                        _v3SubStandard = standard;
                        continue;

                    case GenerateV2CompatibleTOCElementName:
                        _generateV2CompatibleTOC = reader.ReadElementContentAsBoolean();
                        continue;

                    case HTMLFileMaxSizeAllowedElementName:
                        HTMLFileMaxSize = (ulong)reader.ReadElementContentAsLong();
                        continue;

                    case FootnotesCreationModeElementName:
                        FootnotesGenerationMode mode;
                        elementContent = reader.ReadElementContentAsString();
                        if (!Enum.TryParse(elementContent, true, out mode))
                        {
                            throw new InvalidDataException(string.Format("Invalid FootnotesCreationMode value read: {0}", elementContent));
                        }
                        FootnotesCreationMode = mode;
                        continue;
                    }
                }
                reader.Read();
            }
        }