void layer_BeforePointRender(object sender, FeatureRenderEventArgs e) { if (_useExtesion) { FeatureStyle fs = GetStyle(e.Feature); e.Feature.PointStyle = fs.PointStyle; e.Feature.TitleStyle = fs.TitleStyle; } }
void featureLayer_BeforePolygonRender(object sender, FeatureRenderEventArgs e) { // clone layer settings for polygon rendering style PolygonStyle style = (PolygonStyle)e.Feature.Layer.PolygonStyle.Clone(); style.FillBackColor = Color.Gray; // change this settings style.UseHatch = true; int f = e.Feature.Geometry.CoordinateCount % 3; switch (f) { case 0: style.HatchStyle = System.Drawing.Drawing2D.HatchStyle.Horizontal; break; case 1: style.HatchStyle = System.Drawing.Drawing2D.HatchStyle.Vertical; break; case 2: style.HatchStyle = System.Drawing.Drawing2D.HatchStyle.Cross; break; } // style changes may be based on the feature attribute values // for example: // style.FillForeColor = Color.FromName(e.Feature["ColorName"].ToString()); // assign changed style to the feature e.Feature.PolygonStyle = style; }
private void beforePointRender(object sender, FeatureRenderEventArgs e) { if (BeforePointRender != null) BeforePointRender(sender, e); }