Esempio n. 1
0
        private GuidelineCollection GetColorSpecificGuidelines(GuidelineColor color)
        {
            var collection = new GuidelineCollection(guidelines.Where(g => g.Color == color), false);

            collection.colors[color] = colors[color];
            return(collection);
        }
Esempio n. 2
0
 /// <summary>Adds a collection of guidelines from the <seealso cref="GuidelineCollection"/>.</summary>
 /// <param name="guidelines">The guidelines to add.</param>
 public GuidelineCollection AddRange(GuidelineCollection guidelines)
 {
     guidelines.AddRange(guidelines.guidelines);
     foreach (var c in guidelines.colors)
     {
         colors[c.Key] += c.Value;
     }
     return(this);
 }
Esempio n. 3
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);
        }
Esempio n. 4
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))
            {
                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);
        }