예제 #1
0
 public void Add(Line2D l)
 {
     _items.Add(l);
     l.Name = string.Format(LineNameFormat, namegen.Next());
     if (LineChanged != null)
         LineChanged(this, l);
     l.PropertyChanged += l_PropertyChanged;
 }
예제 #2
0
        void _lat_LineRemoved(object sender, Line2D ll)
        {
            UIElement toremove = null;
            foreach (UIElement uie in LatticeCanvas.Children)
            {
                if ((uie is Shape) && (uie as Shape).Name.StartsWith(ll.Name))
                {
                    toremove = uie;
                    break;
                }
            }

            if (toremove != null)
                LatticeCanvas.Children.Remove(toremove);
        }
예제 #3
0
 public void Remove(Line2D l)
 {
     if (l == null) return;
     l.PropertyChanged -= l_PropertyChanged;
     _items.Remove(l);
     if (LineRemoved != null)
         LineRemoved(this, l);
     
 }
예제 #4
0
 Line CreateLine(Line2D ll)
 {
     Line l = ll.Visual;
     AttachPointerEvents(ref l);
     l.Stroke = (ll.Name == lastHilightName) ? hiliteBrush : normalBrush;
     return l;
 }
예제 #5
0
 Line ReCreateLineWithIndex(Line2D ll)
 {
     Tuple<double, double> t = ScaleFactors;
     double st = lwidth / Math.Min(t.Item1, t.Item2);
     Line l = ll.Visual;
     AttachPointerEvents(ref l);
     l.Stroke = (ll.Name == lastHilightName) ? hiliteBrush : normalBrush;
     l.StrokeThickness = st;
     return l;
 }
예제 #6
0
 private void Add_Line_Click(object sender, RoutedEventArgs e)
 {
     LatticeData ld = (viewModel.CurrentPathData as LatticeData);
     if (ld == null) return;
     Line2D l = new Line2D(new Point(0, 0), new Point(ld.Columns - 1, ld.Rows - 1));
     ld.Add(l);
 }
예제 #7
0
파일: ViewModel.cs 프로젝트: dolkensp/OTWB
 void l_LineChanged(object sender, Line2D e)
 {
     if (LatticeDataChanged != null)
         LatticeDataChanged(this, new EventArgs());
 }