/// ------------------------------------------------------------------------------------ /// <summary> /// Returns a clone of the list of punctuation patterns. /// </summary> /// ------------------------------------------------------------------------------------ public PuncPatternsList Clone() { PuncPatternsList clone = new PuncPatternsList(); foreach (PuncPattern pattern in this) { clone.Add(pattern.Clone()); } return(clone); }
/// ------------------------------------------------------------------------------------ /// <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()); }