コード例 #1
0
        public void DeleteObjects(IEnumerable <IDrawObject> objects)
        {
            EditCommandRemove undocommand = null;

            if (m_undoBuffer.CanCapture)
            {
                undocommand = new EditCommandRemove();
            }
            foreach (ICanvasLayer layer in m_layers)
            {
                List <IDrawObject> removedobjects = ((DrawingLayer)layer).DeleteObjects(objects);
                if (removedobjects != null && undocommand != null)
                {
                    undocommand.AddLayerObjects(layer, removedobjects);
                }
            }
            if (undocommand != null)
            {
                m_undoBuffer.AddCommand(undocommand);
            }
        }
コード例 #2
0
ファイル: Model.cs プロジェクト: sduxiaowu/NineLineScore
 public void DeleteObjects(IEnumerable<IDrawObject> objects)
 {
     EditCommandRemove undocommand = null;
     if (m_undoBuffer.CanCapture)
         undocommand = new EditCommandRemove();
     foreach (ICanvasLayer layer in m_layers)
     {
         List<IDrawObject> removedobjects = ((DrawingLayer)layer).DeleteObjects(objects);
         if (removedobjects != null && undocommand != null)
             undocommand.AddLayerObjects(layer, removedobjects);
     }
     if (undocommand != null)
         m_undoBuffer.AddCommand(undocommand);
 }