Exemple #1
0
        /// <summary>Parses the guideline string into a <seealso cref="GuidelineCollection"/>.</summary>
        /// <param name="guidelineString">The guideline string to parse.</param>
        public static GuidelineCollection Parse(string guidelineString)
        {
            var guidelines = new GuidelineCollection();

            if (string.IsNullOrEmpty(guidelineString) || guidelineString == "~")
            {
                return(guidelines);
            }

            string[] s = guidelineString.Split('~');
            for (int i = 0; i < s.Length - 1; i += 2)
            {
                guidelines.Add(ParseDouble(s[i]), ParseDouble(s[i + 1]));
            }
            return(guidelines);
        }
        /// <summary>Parses the guideline string into a <seealso cref="GuidelineCollection"/>.</summary>
        /// <param name="guidelineString">The guideline string to parse.</param>
        public static GuidelineCollection Parse(string guidelineString)
        {
            var guidelines = new GuidelineCollection();

            if (!string.IsNullOrEmpty(guidelineString))
            {
                if (guidelineString.EndsWith("~"))
                {
                    guidelineString = guidelineString.Remove(guidelineString.Length - 1);
                }
                string[] s = guidelineString.Split('~');
                for (int i = 0; i < s.Length; i += 2)
                {
                    guidelines.Add(ToDouble(s[i]), ToDouble(s[i + 1]));
                }
            }
            return(guidelines);
        }