Example #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 <ModalitySummary> addedItems)
        {
            addedItems = new List <ModalitySummary>();
            ModalityEditorComponent      editor   = new ModalityEditorComponent();
            ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
                this.Host.DesktopWindow, editor, SR.TitleAddModality);

            if (exitCode == ApplicationComponentExitCode.Accepted)
            {
                addedItems.Add(editor.ModalitySummary);
                return(true);
            }
            return(false);
        }
Example #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 <ModalitySummary> items, out IList <ModalitySummary> editedItems)
        {
            editedItems = new List <ModalitySummary>();
            ModalitySummary item = CollectionUtils.FirstElement(items);

            ModalityEditorComponent      editor   = new ModalityEditorComponent(item.ModalityRef);
            ApplicationComponentExitCode exitCode = ApplicationComponent.LaunchAsDialog(
                this.Host.DesktopWindow, editor, string.Format(SR.FormatTitleCodeSubtitle, SR.TitleUpdateModality, item.Id, item.Name));

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