コード例 #1
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Creates a MatchedPairList from the specified XML string.
        /// </summary>
        /// <param name="xmlSrc">The XML source string to load.</param>
        /// <param name="wsName">Name of the writing system (used for error reporting).</param>
        /// ------------------------------------------------------------------------------------
        public static MatchedPairList Load(string xmlSrc, string wsName)
        {
            Exception       e;
            MatchedPairList list = XmlSerializationHelper.DeserializeFromString <MatchedPairList>(xmlSrc, out e);

            if (e != null)
            {
                throw new ContinuableErrorException("Invalid MatchedPairs field while loading the " +
                                                    wsName + " writing system.", e);
            }
            return(list ?? new MatchedPairList());
        }
コード例 #2
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Creates a PuncPatternsList from the specified XML string.
        /// </summary>
        /// <param name="xmlSrc">The XML source string to load.</param>
        /// <param name="wsName">Name of the writing system (used for error reporting).</param>
        /// ------------------------------------------------------------------------------------
        public static PuncPatternsList Load(string xmlSrc, string wsName)
        {
            Exception        e;
            PuncPatternsList list = XmlSerializationHelper.DeserializeFromString <PuncPatternsList>(xmlSrc, out e);

            if (e != null)
            {
                throw new ContinuableErrorException("Invalid PunctuationPatterns field while loading the " +
                                                    wsName + " writing system.", e);
            }

            return(list ?? new PuncPatternsList());
        }
コード例 #3
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        /// Creates a QuotationMarksList from the specified XML string.
        /// </summary>
        /// <param name="xmlSrc">The XML source string to load.</param>
        /// <param name="wsName">Name of the writing system (used for error reporting).</param>
        /// ------------------------------------------------------------------------------------
        public static QuotationMarksList Load(string xmlSrc, string wsName)
        {
            Exception          e;
            QuotationMarksList list =
                XmlSerializationHelper.DeserializeFromString <QuotationMarksList>(xmlSrc, out e);

            if (e != null)
            {
                throw new ContinuableErrorException("Invalid QuotationMarks field while loading the " +
                                                    wsName + " writing system.", e);
            }

            return(list == null || list.Levels == 0 ? NewList() : list);
        }
コード例 #4
0
 /// ------------------------------------------------------------------------------------
 /// <summary>
 /// Loads the specified XML source.
 /// </summary>
 /// <param name="xmlSource">The XML source.</param>
 /// <returns>information about the styles deserialized from the XML source</returns>
 /// ------------------------------------------------------------------------------------
 public static StylePropsInfo Load(string xmlSource)
 {
     return(XmlSerializationHelper.DeserializeFromString <StylePropsInfo>(xmlSource));
 }