예제 #1
0
파일: Model.cs 프로젝트: 106820026/Painter
 // 重新讀取list
 public void ReloadAllShapes(List <IShape> shapes)
 {
     GetTotalShapes.Clear();
     Console.WriteLine(shapes.Count);
     foreach (IShape shape in shapes)
     {
         GetTotalShapes.Add(shape);
     }
     NotifyModelChanged();
 }
예제 #2
0
파일: Model.cs 프로젝트: 106820026/Painter
 // 從所有形狀中移除選取的
 public void RemoveSelectedShapeFromTotalShapes()
 {
     GetTotalShapes.RemoveAt(GetSelectedShapeIndex());
 }
예제 #3
0
파일: Model.cs 프로젝트: 106820026/Painter
 // 從所有形狀中插入選取的
 public void InsertSelectedShapeFromTotalShapes(int index)
 {
     GetTotalShapes.Insert(index, SelectedShape);
 }
예제 #4
0
파일: Model.cs 프로젝트: 106820026/Painter
 // 取得選取的形狀的索引
 public int GetSelectedShapeIndex()
 {
     return(GetTotalShapes.FindIndex(selectShape => selectShape == SelectedShape));
 }