public override void UpdateColor(Color color, int?year) { if (year != null) { var doYear = (int)year; int calcYear = doYear * 4; bool update = false; for (int i = calcYear; i < (calcYear + 4); i++) { update = (YearToColor.ContainsKey(i)) || update; } if (update) { string classValue = string.Format("{0}, {1}, {2}", doYear, false, true); for (int j = calcYear; j < calcYear + 4; j++) { if (YearToColor.ContainsKey(j)) { YearToColor[j] = color; } } ArcUtils.SetColorToLayer(Layer, color, classValue); if (YearPip.Contains(calcYear)) { classValue = string.Format("{0}, {1}, {2}", doYear, true, true); ISymbol symbol = ArcUtils.GetPipSymbol(SizeLayer, color); ArcUtils.SetSymbolToLayer(Layer, symbol, classValue); } if (YearForbidden.Contains(calcYear)) { classValue = string.Format("{0}, {1}, {2}", doYear, false, false); ISymbol symbol = ArcUtils.GetForbiddenSymbol(SizeLayer, color); ArcUtils.SetSymbolToLayer(Layer, symbol, classValue); if (YearPip.Contains(calcYear)) { classValue = string.Format("{0}, {1}, {2}", doYear, true, false); ArcUtils.SetSymbolToLayer(Layer, symbol, classValue); } } Refresh(); } } }
public override void UpdateColor(Color color, int?year) { if (year != null) { var doYear = (int)year; if (YearToColor.ContainsKey(doYear)) { string classValue = string.Format("{0}, {1}, {2}", doYear, false, true); YearToColor[doYear] = color; ArcUtils.SetColorToLayer(Layer, color, classValue); if (YearPip.Contains(doYear)) { classValue = string.Format("{0}, {1}, {2}", doYear, true, true); ISymbol symbol = ArcUtils.GetPipSymbol(SizeLayer, color); ArcUtils.SetSymbolToLayer(Layer, symbol, classValue); } if (YearForbidden.Contains(doYear)) { classValue = string.Format("{0}, {1}, {2}", doYear, false, false); ISymbol symbol = ArcUtils.GetForbiddenSymbol(SizeLayer, color); ArcUtils.SetSymbolToLayer(Layer, symbol, classValue); if (YearPip.Contains(doYear)) { classValue = string.Format("{0}, {1}, {2}", doYear, true, false); ArcUtils.SetSymbolToLayer(Layer, symbol, classValue); } } Refresh(); } } }