Nelson,
Here is the code for the railways, you can modify it as you see fit.
David
public static LineStyle Railway1
{
get
{
Collection<float> dashPattern = new Collection<float>();
dashPattern.Add(0.25F);
dashPattern.Add(1);
return CreateRailWayStyle(GeoColor.StandardColors.White, 2, GeoColor.StandardColors.DarkGray, 4, GeoColor.StandardColors.DarkGray, 6, dashPattern);
}
}
public static LineStyle Railway2
{
get
{
Collection<float> dashPattern = new Collection<float>();
dashPattern.Add(.25F);
dashPattern.Add(1f);
return CreateRailWayStyle(GeoColor.StandardColors.White, 1.8F, GeoColor.StandardColors.DarkGray, 3.2F, GeoColor.StandardColors.DarkGray, 5.2F, dashPattern);
}
}
public static LineStyle Railway3
{
get
{
Collection<float> dashPattern = new Collection<float>();
dashPattern.Add(.25F);
dashPattern.Add(1f);
return CreateRailWayStyle(GeoColor.StandardColors.White, 1.2F, GeoColor.StandardColors.DarkGray, 2.2F, GeoColor.StandardColors.DarkGray, 3.2F, dashPattern);
}
}
public static LineStyle Railway4
{
get
{
GeoColor innerLineColor = GeoColor.StandardColors.Transparent;
GeoColor outerLineColor = GeoColor.StandardColors.Transparent;
GeoColor centerlineColor = GeoColor.StandardColors.Black;
float innerLineWidth = 1;
float outerLineWidth = 1;
float centerlineWidth = 1;
LineDashStyle innerLineDashStyle = LineDashStyle.Solid;
LineDashStyle outerLineDashStyle = LineDashStyle.Solid;
LineDashStyle centerlineDashStyle = LineDashStyle.Dash;
GeoPen innerPen = new GeoPen(innerLineColor, innerLineWidth);
innerPen.DashStyle = innerLineDashStyle;
GeoPen outerPen = new GeoPen(outerLineColor, outerLineWidth);
outerPen.DashStyle = outerLineDashStyle;
GeoPen centerPen = new GeoPen(centerlineColor, centerlineWidth);
centerPen.DashStyle = centerlineDashStyle;
return new LineStyle(outerPen, innerPen, centerPen);
}
}
private static LineStyle CreateRailWayStyle(GeoColor innerPenColor, float innerPenWidth, GeoColor outerPenColor, float outerPenWidth, GeoColor centerPenColor, float centerPenWidth, Collection<float> dashPattern)
{
LineStyle lineStyle = new LineStyle();
lineStyle.InnerPen = new GeoPen(innerPenColor, innerPenWidth);
lineStyle.OuterPen = new GeoPen(outerPenColor, outerPenWidth);
GeoPen centerPen = new GeoPen(centerPenColor, centerPenWidth);
centerPen.DashPattern.Add(dashPattern[0]);
centerPen.DashPattern.Add(dashPattern[1]);
lineStyle.CenterPen = centerPen;
return lineStyle;
}