Esempio n. 1
0
        /// <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 <AuthorityGroupSummary> addedItems)
        {
            addedItems = new List <AuthorityGroupSummary>();
            var editor   = new AuthorityGroupEditorComponent();
            var exitCode = LaunchAsDialog(
                Host.DesktopWindow, editor, SR.TitleAddAuthorityGroup);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                addedItems.Add(editor.AuthorityGroupSummary);
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        /// <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 <AuthorityGroupSummary> items, out IList <AuthorityGroupSummary> editedItems)
        {
            editedItems = new List <AuthorityGroupSummary>();
            var item = CollectionUtils.FirstElement(items);

            var editor   = new AuthorityGroupEditorComponent(item, false);
            var exitCode = LaunchAsDialog(
                Host.DesktopWindow, editor, SR.TitleUpdateAuthorityGroup + " - " + item.Name);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                editedItems.Add(editor.AuthorityGroupSummary);
                return(true);
            }
            return(false);
        }
Esempio n. 3
0
        public void DuplicateSelectedItem()
        {
            try
            {
                var item = CollectionUtils.FirstElement(SelectedItems);
                if (item == null)
                {
                    return;
                }

                var editor   = new AuthorityGroupEditorComponent(item, true);
                var exitCode = LaunchAsDialog(
                    Host.DesktopWindow, editor, SR.TitleUpdateAuthorityGroup);
                if (exitCode == ApplicationComponentExitCode.Accepted)
                {
                    Table.Items.Add(editor.AuthorityGroupSummary);
                    SummarySelection = new Selection(editor.AuthorityGroupSummary);
                }
            }
            catch (Exception e)
            {
                ExceptionHandler.Report(e, Host.DesktopWindow);
            }
        }