private void FillComboBox() { SelectionTargetComboBox selCombo = SelectionTargetComboBox.GetSelectionComboBox(); if (selCombo == null) { return; } selCombo.ClearAll(); IFeatureLayer featureLayer; // Loop through the layers in the map and add the layer's name to the combo box. for (int i = 0; i < m_map.LayerCount; i++) { if (m_map.get_Layer(i) is IFeatureSelection) { featureLayer = m_map.get_Layer(i) as IFeatureLayer; if (featureLayer == null) { break; } selCombo.AddItem(featureLayer.Name, featureLayer); } } }
private void Uninitialize() { if (s_extension == null) { return; } // Detach event handlers IActiveViewEvents_Event avEvent = m_map as IActiveViewEvents_Event; avEvent.ItemAdded -= AvEvent_ItemAdded; avEvent.ItemDeleted -= AvEvent_ItemAdded; avEvent.SelectionChanged -= UpdateSelCountDockWin; avEvent.ContentsChanged -= avEvent_ContentsChanged; avEvent = null; // Update UI SelectionTargetComboBox selCombo = SelectionTargetComboBox.GetSelectionComboBox(); if (selCombo != null) { selCombo.ClearAll(); } SelCountDockWin.SetEnabled(false); }
public SelectionTargetComboBox() { m_selAllCookie = -1; s_comboBox = this; }