/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) { return; } m_comboBoxHook = hook as IComboBoxHook; IApplication application = m_comboBoxHook.Hook as IApplication; m_doc = application.Document as IMxDocument; //Disable if it is not ArcMap if (m_comboBoxHook.Hook is IMxApplication) { base.m_enabled = true; } else { base.m_enabled = false; } }
/// <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); } } }
/// <summary> /// Occurs when this command is created /// </summary> /// <param name="hook">Instance of the application</param> public override void OnCreate(object hook) { if (hook == null) return; m_comboBoxHook = hook as IComboBoxHook; IApplication application = m_comboBoxHook.Hook as IApplication; m_doc = application.Document as IMxDocument; //Disable if it is not ArcMap if (m_comboBoxHook.Hook is IMxApplication) base.m_enabled = true; else base.m_enabled = false; }