コード例 #1
0
ファイル: HatchStyleLines.cs プロジェクト: SOFAgh/CADability
 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);
             }
         }
     }
 }
コード例 #2
0
ファイル: LineWidthList.cs プロジェクト: SOFAgh/CADability
        /// <summary>
        /// Returns a copy of this LineWidthList. The entries are cloned so the copy is independant.
        /// </summary>
        /// <returns></returns>
        public LineWidthList Clone()
        {
            LineWidthList res = new LineWidthList();

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