private static void ConfigureGridAppearance() { MajorGrid.With(sf => { //appearance for unselected grids sf.DefaultDrawingOptions.FillVisible = false; sf.DefaultDrawingOptions.LineWidth = 2; sf.DefaultDrawingOptions.LineColor = new Utils().ColorByName(tkMapColor.Red); var fldIndex = sf.FieldIndexByName["grid_no"]; sf.GenerateLabels(fldIndex, tkLabelPositioning.lpCenter); sf.Labels.FontSize = 12; sf.Labels.FontBold = true; sf.Labels.FrameVisible = false; //create a category which will set the appearance of selected grids if (sf.StartEditingTable(null)) { var category = new ShapefileCategory { Name = "Selected grid", Expression = @"[toGrid] =""T""" }; category.DrawingOptions.FillColor = new Utils().ColorByName(tkMapColor.Red); category.DrawingOptions.FillTransparency = 25; category.DrawingOptions.LineWidth = 2; category.DrawingOptions.LineColor = new Utils().ColorByName(tkMapColor.Red); sf.Categories.Add2(category); } }); }
/// <summary> /// Clones this instance. /// </summary> /// <returns>A new object that is a copy of this instance.</returns> public AxisGridOptions Clone() { var clonned = (AxisGridOptions)MemberwiseClone(); clonned.MajorGrid = MajorGrid.Clone(); clonned.MinorGrid = MinorGrid.Clone(); return(clonned); }