public void Point_AttributeChanged(object sender, AttributeChangedArgs a) { switch (a.AttributeType) { case RepAttributes.InnerColor: FrontEnd.SetRepInnerColor(a.RepresentationID, (Color)a.NewAttributeValue); break; case RepAttributes.OuterColor: FrontEnd.SetRepOuterColor(a.RepresentationID, (Color)a.NewAttributeValue); break; case RepAttributes.Position: FrontEnd.SetRepPosition(a.RepresentationID, (Point)a.NewAttributeValue); break; case RepAttributes.Mobility: FrontEnd.ShowMobility(a.RepresentationID, (bool)a.NewAttributeValue); break; } }
void EllipseClick(object sender, MouseButtonEventArgs e) { int key = int.Parse(((Ellipse)sender).Name); AttributeChangedArgs ac = new AttributeChangedArgs(key, RepAttributes.Mobility, null); EllipseMobilityToggle(this, ac); }
void Point_ToggleMobile(object sender, AttributeChangedArgs e) { MainGraph.ToggleMobility(e.RepresentationID); }
public void MoveTo(int x, int y) { if (IsMobile) { this.X = x; this.Y = y; AttributeChangedArgs aca = new AttributeChangedArgs(this.ID, RepAttributes.Position, new Point(X, Y)); if (AttributeChanged != null) { AttributeChanged(this, aca); } } }
public void ToggleMobility() { IsMobile = !IsMobile; AttributeChangedArgs ac = new AttributeChangedArgs(this.ID, RepAttributes.Mobility, IsMobile); if (AttributeChanged != null) AttributeChanged(this, ac); }
public void SetInnerColor(Color newColor, RepAttributes colorType) { RepInnerColor = newColor; AttributeChangedArgs aca; if (colorType == RepAttributes.InnerColor) aca = new AttributeChangedArgs(this.ID, RepAttributes.InnerColor, newColor); else aca = new AttributeChangedArgs(this.ID, RepAttributes.InnerColor, newColor); if (AttributeChanged != null) { AttributeChanged(this, aca); } }