private void SelectWeatherItems()
{
//get the selected list from the listbox
bool newSelection = this.chkNewSelection.Checked;
//in case of a new selection, unselect all items first
if(newSelection)
m_weatherLayer.UnselectAll();
IPropertySet propSet = null;
object o;
long zipCode;
//iterate through the selected items of the listbox
foreach(int index in lstWeatherItemNames.SelectedIndices)
{
//get the weatheritem properties according to the zipCode of the item in the listbox
propSet = m_weatherLayer.GetWeatherItem(Convert.ToString(lstWeatherItemNames.Items[index]));
if(null == propSet)
continue;
o = propSet.GetProperty("ZIPCODE");
if(null == o)
continue;
zipCode = Convert.ToInt64(o);
//select the item in the weather layer
m_weatherLayer.Select(zipCode, false);
}
//refresh the display
m_activeView.PartialRefresh(esriViewDrawPhase.esriViewGeography, m_weatherLayer, m_activeView.Extent);
m_activeView.ScreenDisplay.UpdateWindow();
}