2 using System.Collections;
3 using System.Collections.Generic;
7 using System.Threading.Tasks;
9 using System.Windows.Media;
10 using System.Windows.Shapes;
21 ArrayList ret =
new ArrayList();
24 ui.
label =
"Right Triangle";
26 System.Reflection.Assembly myAssembly = System.Reflection.Assembly.GetExecutingAssembly();
27 System.IO.Stream myStream = myAssembly.GetManifestResourceStream(
"ShapeLib.icons.right-triangle.png");
28 ui.
image =
new System.Drawing.Bitmap(myStream);
47 Polygon myTri =
new Polygon();
50 SolidColorBrush mySolidColorBrush =
new SolidColorBrush();
52 PointCollection Points =
new PointCollection();
59 myTri.Points =
new PointCollection(Points);
60 myTri.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
61 myTri.VerticalAlignment = VerticalAlignment.Center;
73 PointCollection Points =
new PointCollection();
78 myTri.Points =
new PointCollection(Points);
90 Polyline myTri =
new Polyline();
93 myTri.Stroke =
new SolidColorBrush(System.Windows.Media.Color.FromRgb(0, 0, 255));
94 PointCollection Points =
new PointCollection();
99 myTri.Points =
new PointCollection(Points);
100 myTri.HorizontalAlignment = System.Windows.HorizontalAlignment.Left;
101 myTri.VerticalAlignment = VerticalAlignment.Center;
114 PointCollection Points =
new PointCollection();
120 myTri.Points =
new PointCollection(Points);
RibbonControlEventHandler click
string belong
判斷按下Button控制項
System.Windows.Point controlBtn3
System.Windows.Point controlBtn4
某一類的形狀.包含UI 的界面,繪製方式.更新方式.新增方式
void myLine_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
void myLine_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
System.Windows.Point controlBtn1
void myLine_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
void btn_Click(object sender, RibbonControlEventArgs e)
UI 點選
override System.Collections.ArrayList getMenuItem()
覆寫System.Collections.ArrayList
System.Drawing.Image image
override void DisplayControlPoints(gView gv, gPath data)
override void DrawShape(gView gv, gPath data, Boolean bfirst)
依data 繪製,如果是第一次畫要新建shape, 更新的話只要更新最後一點
List< Shape > controlShape