internal void AddItem(string itemName, IFeatureLayer layer) { if (m_selAllCookie == -1) { m_selAllCookie = m_comboBoxHook.Add("Select All"); } //Add each item to combo box. int cookie = m_comboBoxHook.Add(itemName); m_list.Add(cookie, layer); }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { IComboBoxHook comboHook = hook as IComboBoxHook; if (comboHook == null) { m_enabled = false; return; } m_application = comboHook.Hook as IApplication; int cookie = 0; foreach (string fileName in RecentFilesRegistryHelper.GetRecentFiles(m_application)) { if (File.Exists(fileName)) { //Add item to list cookie = comboHook.Add(fileName); m_itemMap.Add(cookie, fileName); } } }