Beispiel #1
0
 internal override void Update(bool AddMissingToList)
 {
     if (Parent != null && Parent.Owner != null)
     {
         ColorList cl = Parent.Owner.ColorList;
         if (cl != null && colorDef != null)
         {
             ColorDef cd = cl.Find(colorDef.Name);
             if (cd != null)
             {
                 colorDef = cd;
             }
             else if (AddMissingToList)
             {
                 cl.Add(colorDef);
             }
         }
         LineWidthList ll = Parent.Owner.LineWidthList;
         if (ll != null && lineWidth != null)
         {
             LineWidth lw = ll.Find(lineWidth.Name);
             if (lw != null)
             {
                 lineWidth = lw;
             }
             else if (AddMissingToList)
             {
                 ll.Add(lineWidth);
             }
         }
         LinePatternList pl = Parent.Owner.LinePatternList;
         if (pl != null && linePattern != null)
         {
             LinePattern lw = pl.Find(linePattern.Name);
             if (lw != null)
             {
                 linePattern = lw;
             }
             else if (AddMissingToList)
             {
                 pl.Add(linePattern);
             }
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// Returns a copy of this LinePatternList. The entries are cloned so the copy is independant.
        /// </summary>
        /// <returns></returns>
        public LinePatternList Clone()
        {
            LinePatternList res = new LinePatternList();

            for (int i = 0; i < entries.Count; ++i)
            {
                res.Add((entries[i] as LinePattern).Clone());
            }
            if (current != null)
            {
                res.current = res.Find(current.Name);
            }
            else
            {
                res.current = null;
            }
            return(res);
        }