/// <summary> /// Refresh Macros For A Particular Label /// </summary> /// <param name="label">The Label</param> public void RefreshMacros(DataContract.Metadata.Label label) { try { if (label == null) { throw new ArgumentNullException("label"); } ListView.SuspendLayout(); var macrosByLabel = _macroManagementService.GetMacrosByLabel(label); ListView.Items.Clear(); foreach (var macro in macrosByLabel) { var macroListItem = new MacroListViewItems.MacroListViewItem(macro); ListView.Items.Add(macroListItem); } ListView.ResumeLayout(); } catch (Exception caught) { logger.Error("Unexpected Error Refreshing Macros For Label", caught); throw; } }
/// <summary> /// Refresh for All Macros /// </summary> public void RefreshMacros() { try { ListView.SuspendLayout(); var allMacros = _macroManagementService.GetAllMacros(); ListView.Items.Clear(); foreach (var macro in allMacros) { var macroListItem = new MacroListViewItems.MacroListViewItem(macro); ListView.Items.Add(macroListItem); } ListView.ResumeLayout(); } catch (Exception caught) { logger.Error("Unexpected Error Refreshing All Macros", caught); throw; } }