// Move the object to the regular layer, where it can be obscured by selected nodes, // unless this node is being deleted. public override void OnLostSelection(GoSelection selection) { if (!this.BeingRemoved) { this.Document.DefaultLayer.Add(this); } base.OnLostSelection(selection); }
// Just change the GoTextNode's background brush color, // rather than adding selection handles. public override void RemoveSelectionHandles(GoSelection selection) { GoShape shape = this.Background as GoShape; if (shape != null) { //shape.FillHalfGradient(myNwoodsNamespaceColor); } }
public override void OnLostSelection(GoSelection sel) { foreach (GoLink link in Links) { link.PenWidth = 3; link.HighlightPenWidth = 0; } UnSelected(this, null); base.OnLostSelection(sel); }
// Just change the GoTextNode's background brush color, // rather than adding selection handles. public override void AddSelectionHandles(GoSelection selection, GoObject selectedObject) { GoShape shape = this.Background as GoShape; if (shape != null) { //shape.BrushStyle = GoBrushStyle.Solid; //shape.BrushColor = Color.DeepPink; } }
public void RemoveLinks(GoSelection links) { links.ToList().Each(link => { if (isBaseLink(link) && isGoLink(link)) { unlinkBaseNodes(link as IBaseLink, link as GoLink); } else if (link.IsAnImplementationOf <INeighborhoodNode>()) { unlinkNeighborhoodNode(link); } }); }
private void RemoveEntityGroup([NotNull] IShape shape) { if (shape is IEntityShape entityShape && (_diagram.Entities?.Contains(entityShape) ?? false) && entityShape.Identity is IEntity entity) { var graphEntity = GetEntity(entity); if (graphEntity != null) { var selection = new GoSelection(null); selection.Add(graphEntity); _graph.DeleteSelection(selection); } }
// only allow resizing vertically public override void AddSelectionHandles(GoSelection sel, GoObject selectedObj) { Lifeline line = this.Parent as Lifeline; if (line != null) { RemoveSelectionHandles(sel); sel.CreateResizeHandle(this, selectedObj, line.GetStepPoint(this.Begin), MiddleTop, true); sel.CreateResizeHandle(this, selectedObj, line.GetStepPoint(this.End), MiddleBottom, true); } else { base.AddSelectionHandles(sel, selectedObj); } }
public override void OnGotSelection(GoSelection sel) { foreach (GoLink link in RightPort.Links) { link.PenWidth = 5; link.HighlightPenWidth = 8; link.HighlightPenColor = System.Drawing.Color.Red; } foreach (GoLink link in LeftPort.Links) { link.HighlightPenWidth = 8; link.PenWidth = 5; link.HighlightPenColor = System.Drawing.Color.Blue; } Selected(this, null); base.OnGotSelection(sel); }
public override void OnGotSelection(GoSelection sel) { oldBrushColor = header.Shape.BrushColor; header.Shape.BrushColor = Color.LightGreen; base.OnGotSelection(sel); }
public override void OnLostSelection(GoSelection sel) { base.OnLostSelection(sel); Deselected?.Invoke(this, new GoSelectionEventArgs(this)); }
public override void OnGotSelection(GoSelection sel) { _link.RaiseSelectedEvent(); DoBeginEdit(sel.View); }
public override void OnLostSelection(GoSelection selection) { base.OnLostSelection(selection); this.SkipsUndoManager = true; this.HighlightPen = new Pen(Color.White, 6); this.SkipsUndoManager = false; }
public override void OnGotSelection(GoSelection selection) { base.OnGotSelection(selection); this.SkipsUndoManager = true; Color c; if (selection.Primary == this) c = selection.View.PrimarySelectionColor; else c = selection.View.SecondarySelectionColor; this.HighlightPen = new Pen(c, 6); this.SkipsUndoManager = false; }
public override void OnLostSelection(GoSelection sel) { header.Shape.BrushColor = oldBrushColor; base.OnGotSelection(sel); }
// can't get any selection handles public override void AddSelectionHandles(GoSelection sel, GoObject selectedObj) { }
// Move the object to the top layer, so it is visible to the user. public override void OnGotSelection(GoSelection selection) { this.Document.Layers.Top.Add(this); base.OnGotSelection(selection); }