//四角形表示 public void DrawLine(System.Windows.Point[] Pt, InOutPutMode mode) { switch (mode) { case InOutPutMode.input: this.InputLine.Points.Clear(); for (int i = 0; i < Pt.Length; i++) { this.InputLine.Points.Add(new System.Windows.Point(Pt[i].X, Pt[i].Y)); } break; case InOutPutMode.output: this.OutputLine.Points.Clear(); for (int i = 0; i < Pt.Length; i++) { this.OutputLine.Points.Add(new System.Windows.Point(Pt[i].X, Pt[i].Y)); } break; } }
//Ellipseの座標 void SetEllipsePositon(System.Windows.Point[] Pt, InOutPutMode mode) { switch (mode) { case InOutPutMode.input: for (int i = 0; i < this.InputE.Length; i++) { Canvas.SetLeft(this.InputE[i], Pt[i].X - this.ellipseR); Canvas.SetTop(this.InputE[i], Pt[i].Y - this.ellipseR); } break; case InOutPutMode.output: for (int i = 0; i < this.OutputE.Length; i++) { Canvas.SetLeft(this.OutputE[i], Pt[i].X - this.ellipseR); Canvas.SetTop(this.OutputE[i], Pt[i].Y - this.ellipseR); } break; } }
System.Windows.Point[] GetEllipsePosition(InOutPutMode mode) { System.Windows.Point[] Pt = new System.Windows.Point[4]; //this.Dispatcher.BeginInvoke(new Action(() => //{ switch (mode) { case InOutPutMode.input: for (int i = 0; i < this.InputE.Length; i++) { Pt[i] = new System.Windows.Point(Canvas.GetLeft(this.InputE[i]) + this.ellipseR, Canvas.GetTop(this.InputE[i]) + this.ellipseR); } break; case InOutPutMode.output: for (int i = 0; i < this.OutputE.Length; i++) { Pt[i] = new System.Windows.Point(Canvas.GetLeft(this.OutputE[i]) + this.ellipseR, Canvas.GetTop(this.OutputE[i]) + this.ellipseR); } break; } //})); return(Pt); }
System.Windows.Point[] GetEllipsePosition(InOutPutMode mode) { System.Windows.Point[] Pt = new System.Windows.Point[4]; //this.Dispatcher.BeginInvoke(new Action(() => //{ switch (mode) { case InOutPutMode.input: for (int i = 0; i < this.InputE.Length; i++) { Pt[i] = new System.Windows.Point(Canvas.GetLeft(this.InputE[i]) + this.ellipseR, Canvas.GetTop(this.InputE[i]) + this.ellipseR); } break; case InOutPutMode.output: for (int i = 0; i < this.OutputE.Length; i++) { Pt[i] = new System.Windows.Point(Canvas.GetLeft(this.OutputE[i]) + this.ellipseR, Canvas.GetTop(this.OutputE[i]) + this.ellipseR); } break; } //})); return Pt; }