public void Init(Point P1, Point P2, Size bound, TripWireDirection direction) { ruleDirection = direction; this.P1 = P1; this.P2 = P2; leftLine = new Line(); rightLine = new Line(); leftLine.Cursor = Cursors.Hand; rightLine.Cursor = Cursors.Hand; leftLine.PreviewMouseLeftButtonDown += new MouseButtonEventHandler((obj, evargs) => { if (ruleDirection != TripWireDirection.FromRight) { ruleDirection = ruleDirection ^ TripWireDirection.FromRight; } Refresh(); }); rightLine.PreviewMouseLeftButtonDown += new MouseButtonEventHandler((obj, evargs) => { if (ruleDirection != TripWireDirection.FromLeft) { ruleDirection = ruleDirection ^ TripWireDirection.FromLeft; } Refresh(); }); bountRct = bound; if (isloaded) { Display(); } isinit = true; }
public void Init(Point P1, Point P2, Size bound, TripWireDirection direction) { ruleDirection = direction; this.P1 = P1; this.P2 = P2; leftLine = new Line(); rightLine = new Line(); leftLine.Cursor = Cursors.Hand; rightLine.Cursor = Cursors.Hand; leftLine.PreviewMouseLeftButtonDown+=new MouseButtonEventHandler((obj, evargs)=>{ if(ruleDirection != TripWireDirection.FromRight) ruleDirection = ruleDirection ^ TripWireDirection.FromRight; Refresh(); }); rightLine.PreviewMouseLeftButtonDown += new MouseButtonEventHandler((obj, evargs) => { if (ruleDirection != TripWireDirection.FromLeft) ruleDirection = ruleDirection ^ TripWireDirection.FromLeft; Refresh(); }); bountRct = bound; if (isloaded) { Display(); } isinit = true; }
public void SetDirection(TripWireDirection direction) { ruleDirection = direction; Refresh(); }
public void SetDirection(TripWireDirection direction) { ruleDirection = direction; Refresh(); }