protected void NDrawingView1_AsyncMouseOut(object sender, EventArgs e) { NCallbackMouseEventArgs args = e as NCallbackMouseEventArgs; if (args.ItemId == null) { return; } NElementAtomIdentifier id = new NElementAtomIdentifier(args.ItemId); NEllipsePath path = id.FindInDocument(NDrawingView1.Document) as NEllipsePath; if (path == null) { return; } NShape shape = NSceneTree.FirstAncestor(path, NFilters.TypeNShape) as NShape; shape.Style.FillStyle = new NColorFillStyle(Color.Linen); }
protected void NDrawingView1_AsyncCustomCommand(object sender, EventArgs e) { NCallbackCustomCommandArgs args = e as NCallbackCustomCommandArgs; NCallbackCommand command = args.Command; switch (command.Name) { case "changeColor": string idText = command.Arguments["id"] as string; if (idText == null) { break; } NElementAtomIdentifier id = new NElementAtomIdentifier(idText); NEllipsePath path = id.FindInDocument(NDrawingView1.Document) as NEllipsePath; if (path == null) { break; } NShape shape = NSceneTree.FirstAncestor(path, NFilters.TypeNShape) as NShape; Color c = Color.Red; if (command.Arguments["color"].ToString() == "blue") { c = Color.Blue; } NColorFillStyle fs = shape.Style.FillStyle as NColorFillStyle; shape.Style.FillStyle = new NColorFillStyle(c); clientSideRedrawRequired = (fs == null || fs.Color != c); break; case "rotate10Degrees": IterateRotatingEllipse(true); break; } }