/// <summary> /// /// </summary> /// <returns></returns> public static StyleLibrary TemplateStyleLibrary() { var sgt = StyleLibrary.Create("Template"); var gs = ShapeStyle.Create("Grid", 255, 222, 222, 222, 255, 222, 222, 222, 1.0); var builder = sgt.Styles.ToBuilder(); builder.Add(gs); sgt.Styles = builder.ToImmutable(); sgt.CurrentStyle = sgt.Styles.FirstOrDefault(); return(sgt); }
/// <summary> /// /// </summary> /// <returns></returns> public static StyleLibrary DefaultStyleLibrary() { var sgd = StyleLibrary.Create("Default"); var builder = sgd.Styles.ToBuilder(); builder.Add(ShapeStyle.Create("Black", 255, 0, 0, 0, 80, 0, 0, 0, 2.0)); builder.Add(ShapeStyle.Create("Yellow", 255, 255, 255, 0, 80, 255, 255, 0, 2.0)); builder.Add(ShapeStyle.Create("Red", 255, 255, 0, 0, 80, 255, 0, 0, 2.0)); builder.Add(ShapeStyle.Create("Green", 255, 0, 255, 0, 80, 0, 255, 0, 2.0)); builder.Add(ShapeStyle.Create("Blue", 255, 0, 0, 255, 80, 0, 0, 255, 2.0)); sgd.Styles = builder.ToImmutable(); sgd.CurrentStyle = sgd.Styles.FirstOrDefault(); return(sgd); }
/// <summary> /// /// </summary> /// <returns></returns> public static Options Create() { var options = new Options() { SnapToGrid = true, SnapX = 15.0, SnapY = 15.0, HitTreshold = 7.0, MoveMode = MoveMode.Point, DefaultIsStroked = true, DefaultIsFilled = false, DefaultIsClosed = true, DefaultIsSmoothJoin = true, DefaultFillRule = XFillRule.EvenOdd, TryToConnect = false }; options.SelectionStyle = ShapeStyle.Create( "Selection", 0x7F, 0x33, 0x33, 0xFF, 0x4F, 0x33, 0x33, 0xFF, 1.0); options.HelperStyle = ShapeStyle.Create( "Helper", 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 1.0); options.PointStyle = ShapeStyle.Create( "Point", 0xFF, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 1.0); options.PointShape = RectanglePointShape(options.PointStyle); return(options); }
/// <summary> /// /// </summary> /// <returns></returns> public static StyleLibrary LinesStyleLibrary() { var sgdl = StyleLibrary.Create("Lines"); var solid = ShapeStyle.Create("Solid", 255, 0, 0, 0, 80, 0, 0, 0, 2.0); solid.Dashes = default(double[]); solid.DashOffset = 0.0; var dash = ShapeStyle.Create("Dash", 255, 0, 0, 0, 80, 0, 0, 0, 2.0); dash.Dashes = new double[] { 2, 2 }; dash.DashOffset = 1.0; var dot = ShapeStyle.Create("Dot", 255, 0, 0, 0, 80, 0, 0, 0, 2.0); dot.Dashes = new double[] { 0, 2 }; dot.DashOffset = 0.0; var dashDot = ShapeStyle.Create("DashDot", 255, 0, 0, 0, 80, 0, 0, 0, 2.0); dashDot.Dashes = new double[] { 2, 2, 0, 2 }; dashDot.DashOffset = 1.0; var dashDotDot = ShapeStyle.Create("DashDotDot", 255, 0, 0, 0, 80, 0, 0, 0, 2.0); dashDotDot.Dashes = new double[] { 2, 2, 0, 2, 0, 2 }; dashDotDot.DashOffset = 1.0; var builder = sgdl.Styles.ToBuilder(); builder.Add(solid); builder.Add(dash); builder.Add(dot); builder.Add(dashDot); builder.Add(dashDotDot); sgdl.Styles = builder.ToImmutable(); sgdl.CurrentStyle = sgdl.Styles.FirstOrDefault(); return(sgdl); }