コード例 #1
0
        /// <summary>
        /// Remove object by index.
        /// Used for Undo.
        /// </summary>
        public void RemoveAt(int index)
        {
            DrawObject o = graphicsList[index];

            //             if (o.DrawArea != null) o.DrawArea.EndTextBoxEdit(false);
            graphicsList.RemoveAt(index);

            //onGateRemoved();
            OnDrawObjsChanged(new ArrayChangedEventArgs <DrawObject>(o, ArrayChangedType.ItemRemoved));
        }
コード例 #2
0
ファイル: GraphicsList.cs プロジェクト: xuanximoming/PIC
 /// <summary>
 /// Replace object in specified place.
 /// Used for Undo.
 /// </summary>
 public void Replace(int index, DrawObject obj)
 {
     if (index >= 0 && index < graphicsList.Count)
     {
         graphicsList.RemoveAt(index);
         graphicsList.Insert(index, obj);
     }
 }