57 if(symbol == null) 58 return false;
59 IFeatureLayer featureLayer = layer as IFeatureLayer; 60 IFeatureClass featureClass = featureLayer.FeatureClass; 61 if(featureClass == null) 62 return false;
63 esriGeometryType geoType = featureClass.ShapeType; 64 switch(geoType) 65 {
66 case esriGeometryType.esriGeometryPoint: 67 {
68 IMarkerSymbol markerSymbol = symbol as IMarkerSymbol; 69 markerSymbol.Color = color; 70 break; 71 }
72 case esriGeometryType.esriGeometryMultipoint: 73 {
74 IMarkerSymbol markerSymbol = symbol as IMarkerSymbol; 75 break; 76 }
77 case esriGeometryType.esriGeometryPolyline: 78 {
79 ISimpleLineSymbol simpleLineSymbol = 80
symbol as ISimpleLineSymbol;
81 simpleLineSymbol.Color = color; 82 break; 83 }
84 case esriGeometryType.esriGeometryPolygon: 85 {
86 IFillSymbol fillSymbol = symbol as IFillSymbol; 87 fillSymbol.Color = color; 88 break; 89 } 90 default:
91 return false; 92 }
93 ISimpleRenderer simpleRenderer = new SimpleRendererClass(); 94 simpleRenderer.Symbol = symbol; 95 IFeatureRenderer featureRenderer = 96
simpleRenderer as IFeatureRenderer;
97 if(featureRenderer == null) 98 return false;
99 IGeoFeatureLayer geoFeatureLayer = featureLayer as IGeoFeatureLayer;