|
Group: Forum Members
Posts: 5,
Visits: 1
|
Here it is: (You can convert these code to inherit from NEllipseShape)
public class NFaiencePolygonShape: NPolygonShape { #region CTors
public NFaiencePolygonShape() { }
public NFaiencePolygonShape(NPointF[] points): base(points) {
}
public NFaiencePolygonShape(NPolygonPath primitive): base(primitive) {
}
#endregion
#region Properties
private string _Key = Guid.NewGuid().ToString(); public string Key { get { return _Key; } }
public int XPFaienceId { get; set; } public FaienceDisplayMode FaienceDisplayMode { get; set; } public bool AutoDecorate { get; set; } public float DerzWidth { get; set; } public float OffsetX { get; set; } public float OffsetY { get; set; } public float RotationAngle { get; set; }
public Color DerzColor { get; set; } public float Tracker { get; set; } public int TamFayansCount { get; set; } public int BrokenFayansCount { get; set; }
#endregion }
public class NCreateFaiencePolygonTool : NCreatePolygonTool { protected override Nevron.Diagram.INDiagramElement CreateElement(bool preview) { NFaiencePolygonShape shape = new NFaiencePolygonShape(); shape.InteractionStyle = new Nevron.Diagram.NInteractionStyle() { GeometryPoints = true, PinPoint = true, RotatedBounds = true, Rotation = true, Bounds = false }; return shape; }
}
usage is like :
nDrawingView.Controller.Tools.Add(new NCreateFaiencePolygonTool() { Name = "FaiencePolygonTool" });
To set current tool:
nDrawingView.Controller.Tools.SingleEnableTools(new string["FaiencePolygonTool"]);
Hope this helps
|