/// <summary>
        /// Called to handle the "add" action.
        /// </summary>
        /// <param name="addedItems"></param>
        /// <returns>True if items were added, false otherwise.</returns>
        protected override bool AddItems(out IList <DepartmentSummary> addedItems)
        {
            addedItems = new List <DepartmentSummary>();
            var editor   = new DepartmentEditorComponent();
            var exitCode = LaunchAsDialog(
                this.Host.DesktopWindow, editor, SR.TitleAddDepartment);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                addedItems.Add(editor.DepartmentSummary);
                return(true);
            }
            return(false);
        }
        /// <summary>
        /// Called to handle the "edit" action.
        /// </summary>
        /// <param name="items">A list of items to edit.</param>
        /// <param name="editedItems">The list of items that were edited.</param>
        /// <returns>True if items were edited, false otherwise.</returns>
        protected override bool EditItems(IList <DepartmentSummary> items, out IList <DepartmentSummary> editedItems)
        {
            editedItems = new List <DepartmentSummary>();
            var item = CollectionUtils.FirstElement(items);

            var editor   = new DepartmentEditorComponent(item.DepartmentRef);
            var exitCode = LaunchAsDialog(
                this.Host.DesktopWindow, editor, string.Format(SR.FormatTitleCodeSubtitle, SR.TitleUpdateDepartment, item.Id, item.Name));

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                editedItems.Add(editor.DepartmentSummary);
                return(true);
            }
            return(false);
        }