public override void Start()
        {
            base.Start();

            // establish default resource resolver on this assembly (not the assembly of the derived class)
            IResourceResolver resourceResolver = new ResourceResolver(typeof(FolderConfigurationNodeBase).Assembly);

            _folderSystemsActionModel = new SimpleActionModel(resourceResolver);
            _folderSystemsActionModel.AddAction(_moveFolderSystemUpKey, SR.TitleMoveUp, "Icons.UpToolSmall.png", SR.TitleMoveUp, MoveFolderSystemUp);
            _folderSystemsActionModel.AddAction(_moveFolderSystemDownKey, SR.TitleMoveDown, "Icons.DownToolSmall.png", SR.TitleMoveDown, MoveFolderSystemDown);
            _folderSystemsActionModel[_moveFolderSystemUpKey].Enabled   = false;
            _folderSystemsActionModel[_moveFolderSystemDownKey].Enabled = false;

            _foldersActionModel = new SimpleActionModel(resourceResolver);
            _foldersActionModel.AddAction(_addFolderKey, SR.TitleAddContainerFolder, "Icons.AddToolSmall.png", SR.TitleAddContainerFolder, AddFolder);
            var editFolderAction = _foldersActionModel.AddAction(_editFolderKey, SR.TitleRenameFolder, "Icons.EditToolSmall.png", SR.TitleRenameFolder, EditFolder);

            _foldersActionModel.AddAction(_deleteFolderKey, SR.TitleDeleteContainerFolder, "Icons.DeleteToolSmall.png", SR.TitleDeleteContainerFolder, DeleteFolder);
            _foldersActionModel.AddAction(_moveFolderUpKey, SR.TitleMoveUp, "Icons.UpToolSmall.png", SR.TitleMoveUp, MoveFolderUp);
            _foldersActionModel.AddAction(_moveFolderDownKey, SR.TitleMoveDown, "Icons.DownToolSmall.png", SR.TitleMoveDown, MoveFolderDown);
            _foldersActionModel.AddAction(_resetFolderSystemKey, SR.TitleReset, "Icons.ResetToolSmall.png", SR.MessageResetAllFolders, ResetFolderSystem);
            _foldersActionModel[_addFolderKey].Enabled         = false;
            _foldersActionModel[_editFolderKey].Enabled        = false;
            _foldersActionModel[_deleteFolderKey].Enabled      = false;
            _foldersActionModel[_moveFolderUpKey].Enabled      = false;
            _foldersActionModel[_moveFolderDownKey].Enabled    = false;
            _foldersActionModel[_resetFolderSystemKey].Enabled = false;

            editFolderAction.KeyStroke = XKeys.F2;

            LoadFolderSystems();
        }
 private void InitializeProcedurePlanSummaryActionHandlers()
 {
     _procedurePlanActionHandler = new SimpleActionModel(new ResourceResolver(this.GetType().Assembly));
     _startAction       = _procedurePlanActionHandler.AddAction("start", SR.TitleStartMps, "Icons.StartToolSmall.png", SR.TitleStartMps, StartModalityProcedureSteps);
     _discontinueAction = _procedurePlanActionHandler.AddAction("discontinue", SR.TitleDiscontinueMps, "Icons.DeleteToolSmall.png", SR.TitleDiscontinueMps, DiscontinueModalityProcedureSteps);
     UpdateActionEnablement();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="configStore">The <see cref="ISettingsStore"/> for which the default values will be modified.</param>
        public SettingsManagementComponent(ISettingsStore configStore)
        {
            _configStore = configStore;

            // define the structure of the settings group table
            ITableColumn _groupNameColumn;

            _settingsGroupTable = new Table <SettingsGroupDescriptor>();
            _settingsGroupTable.Columns.Add(_groupNameColumn = new TableColumn <SettingsGroupDescriptor, string>(SR.TitleGroup,
                                                                                                                 delegate(SettingsGroupDescriptor t) { return(t.Name); }));
            _settingsGroupTable.Columns.Add(new TableColumn <SettingsGroupDescriptor, string>(SR.TitleVersion,
                                                                                              delegate(SettingsGroupDescriptor t) { return(t.Version.ToString()); }));
            _settingsGroupTable.Columns.Add(new TableColumn <SettingsGroupDescriptor, string>(SR.TitleDescription,
                                                                                              delegate(SettingsGroupDescriptor t) { return(t.Description); }));
            _settingsGroupTable.Sort(new TableSortParams(_groupNameColumn, true));

            // define the settings properties table
            ITableColumn _propertyNameColumn;

            _settingsPropertiesTable = new Table <SettingsProperty>();
            _settingsPropertiesTable.Columns.Add(_propertyNameColumn = new TableColumn <SettingsProperty, string>(SR.TitleProperty,
                                                                                                                  delegate(SettingsProperty p) { return(p.Name); }));
            _settingsPropertiesTable.Columns.Add(new TableColumn <SettingsProperty, string>(SR.TitleDescription,
                                                                                            delegate(SettingsProperty p) { return(p.Description); }));
            _settingsPropertiesTable.Columns.Add(new TableColumn <SettingsProperty, string>(SR.TitleScope,
                                                                                            delegate(SettingsProperty p) { return(p.Scope.ToString()); }));
            _settingsPropertiesTable.Columns.Add(new TableColumn <SettingsProperty, string>(SR.TitleType,
                                                                                            delegate(SettingsProperty p) { return(p.TypeName); }));
            _settingsPropertiesTable.Columns.Add(new TableColumn <SettingsProperty, string>(SR.TitleDefaultValue,
                                                                                            delegate(SettingsProperty p) { return(p.DefaultValue); }));
            _settingsPropertiesTable.Columns.Add(new TableColumn <SettingsProperty, string>(SR.TitleValue,
                                                                                            delegate(SettingsProperty p) { return(p.Value); },
                                                                                            delegate(SettingsProperty p, string text) { p.Value = text; }));
            _settingsPropertiesTable.Sort(new TableSortParams(_propertyNameColumn, true));

            _settingsGroupsActionModel = new SimpleActionModel(new ApplicationThemeResourceResolver(this.GetType().Assembly));
            _importAction = _settingsGroupsActionModel.AddAction("import", SR.LabelImport, "ImportToolSmall.png",
                                                                 SR.TooltipImportSettingsMetaData,
                                                                 Import);
            _importAction.Visible = _configStore.SupportsImport;

            _settingsPropertiesActionModel = new SimpleActionModel(new ApplicationThemeResourceResolver(this.GetType().Assembly));

            _saveAllAction = _settingsPropertiesActionModel.AddAction("saveall", SR.LabelSaveAll, "SaveToolSmall.png",
                                                                      delegate() { SaveModifiedSettings(false); });

            _editAction = _settingsPropertiesActionModel.AddAction("edit", SR.LabelEdit, "EditToolSmall.png",
                                                                   delegate() { EditProperty(_selectedSettingsProperty); });

            _resetAction = _settingsPropertiesActionModel.AddAction("reset", SR.LabelReset, "ResetToolSmall.png",
                                                                    delegate() { ResetPropertyValue(_selectedSettingsProperty); });

            _resetAllAction = _settingsPropertiesActionModel.AddAction("resetall", SR.LabelResetAll, "ResetAllToolSmall.png",
                                                                       delegate() { ResetAllPropertyValues(); });
        }
Ejemplo n.º 4
0
        public override void Start()
        {
            _availableProtocolCodes = new ProtocolCodeTable();
            _selectedProtocolCodes  = new ProtocolCodeTable();

            _selectedProtocolCodesActionHandler = new SimpleActionModel(new ResourceResolver(this.GetType().Assembly));
            _selectedProtocolCodesActionHandler.AddAction(_moveCodeUpKey, SR.TitleMoveProtocolCodeUp, "Icons.UpToolSmall.png", SR.TitleMoveProtocolCodeUp, MoveProtocolCodeUp);
            _selectedProtocolCodesActionHandler.AddAction(_moveCodeDownKey, SR.TitleMoveProtocolCodeDown, "Icons.DownToolSmall.png", SR.TitleMoveProtocolCodeDown, MoveProtocolCodeDown);
            _selectedProtocolCodesActionHandler.AddAction(_newCodeKey, SR.TitleNewProtocolCode, "Icons.AddToolSmall.png", SR.TitleNewProtocolCode, AddNewProtocolCode);
            _selectedProtocolCodesActionHandler[_moveCodeUpKey].Enabled   = false;
            _selectedProtocolCodesActionHandler[_moveCodeDownKey].Enabled = false;
            _selectedProtocolCodesActionHandler[_newCodeKey].Enabled      = true;

            _availableReadingGroups = new ProcedureTypeGroupSummaryTable();
            _selectedReadingGroups  = new ProcedureTypeGroupSummaryTable();

            Platform.GetService <IProtocolAdminService>(service =>
            {
                var editFormDataResponse = service.GetProtocolGroupEditFormData(new GetProtocolGroupEditFormDataRequest());

                _availableProtocolCodes.Items.AddRange(editFormDataResponse.ProtocolCodes);
                _availableReadingGroups.Items.AddRange(editFormDataResponse.ReadingGroups);

                if (_isNew)
                {
                    _protocolGroupDetail = new ProtocolGroupDetail();
                }
                else
                {
                    var response = service.LoadProtocolGroupForEdit(new LoadProtocolGroupForEditRequest(_protocolGroupRef));

                    _protocolGroupDetail = response.Detail;

                    _selectedProtocolCodes.Items.AddRange(_protocolGroupDetail.Codes);
                    _selectedReadingGroups.Items.AddRange(_protocolGroupDetail.ReadingGroups);
                }

                foreach (var item in _selectedProtocolCodes.Items)
                {
                    _availableProtocolCodes.Items.Remove(item);
                }

                foreach (var item in _selectedReadingGroups.Items)
                {
                    _availableReadingGroups.Items.Remove(item);
                }
            });

            base.Start();
        }
        public override void Start()
        {
            base.Start();

            _uiThreadContext = SynchronizationContext.Current;

            _reportTable = new Table <ReportItem>();
            _reportTable.Columns.Add(new TableColumn <ReportItem, string>("Category", delegate(ReportItem item) { return(item.Category); }));
            _reportTable.Columns.Add(new TableColumn <ReportItem, string>("Identifier", delegate(ReportItem item) { return(item.Identifier); }));
            _reportTable.Columns.Add(new TableColumn <ReportItem, int>("#Calls", delegate(ReportItem item) { return(item.NumberOfCalls); }));
            _reportTable.Columns.Add(new TableColumn <ReportItem, string>("Time", delegate(ReportItem item) { return(item.CumulativeTime.ToString()); }));

            _menuModel = new SimpleActionModel(new ResourceResolver(this.GetType().Assembly));
            _menuModel.AddAction("reset", "Reset", null, null, Reset);

            PerformanceReportBroker.Report += OnReceivedReport;
        }
        private void InitializeMenuAndToolbar()
        {
            ResourceResolver resolver = new ApplicationThemeResourceResolver(this.GetType().Assembly);

            _toolbarModel = new SimpleActionModel(resolver);
            _toolbarModel.AddAction("add", SR.LabelAdd, "AddToolSmall.png", OnAdd);
            _toolbarModel.AddAction("edit", SR.LabelEdit, "EditToolSmall.png", OnEditSelected);
            _toolbarModel.AddAction("delete", SR.LabelDelete, "DeleteToolSmall.png", OnDeleteSelected);

            _contextMenuModel = new SimpleActionModel(resolver);
            _contextMenuModel.AddAction("add", SR.LabelAdd, "AddToolSmall.png", OnAdd);
            _contextMenuModel.AddAction("edit", SR.LabelEdit, "EditToolSmall.png", OnEditSelected);
            _contextMenuModel.AddAction("delete", SR.LabelDelete, "DeleteToolSmall.png", OnDeleteSelected);

            _toolbarModel["add"].Visible     = !HasMultipleFactories;
            _contextMenuModel["add"].Visible = !HasMultipleFactories;

            UpdateButtonStates();
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public SettingsManagementComponent(ISettingsStore settingsStore)
        {
            _settingsStore = settingsStore;

            // define the structure of the settings group table
            ITableColumn groupNameColumn;

            _settingsGroupTable = new Table <Group>();
            _settingsGroupTable.Columns.Add(groupNameColumn = new TableColumn <Group, string>(SR.TitleGroup, t => t.Name, 0.4f));
            _settingsGroupTable.Columns.Add(new TableColumn <Group, string>(SR.TitleVersion, t => t.Version.ToString(), 0.1f));
            _settingsGroupTable.Columns.Add(new TableColumn <Group, string>(SR.TitleDescription, t => t.Description, 0.5f));
            _settingsGroupTable.Sort(new TableSortParams(groupNameColumn, true));

            // define the settings properties table
            ITableColumn propertyNameColumn;

            _settingsPropertiesTable = new Table <Property>();
            _settingsPropertiesTable.Columns.Add(propertyNameColumn = new TableColumn <Property, string>(SR.TitleProperty, p => p.Name));
            _settingsPropertiesTable.Columns.Add(new TableColumn <Property, string>(SR.TitleDescription, p => p.Description));
            _settingsPropertiesTable.Columns.Add(new TableColumn <Property, string>(SR.TitleScope, p => p.Scope.ToString()));
            _settingsPropertiesTable.Columns.Add(new TableColumn <Property, string>(SR.TitleType, p => p.TypeName));
            _settingsPropertiesTable.Columns.Add(new TableColumn <Property, string>(SR.TitleDefaultValue, p => p.DefaultValue));
            _settingsPropertiesTable.Columns.Add(new TableColumn <Property, string>(SR.TitleValue, p => p.Value, (p, text) => p.Value = text));
            _settingsPropertiesTable.Sort(new TableSortParams(propertyNameColumn, true));

            _settingsGroupsActionModel = new SimpleActionModel(new ApplicationThemeResourceResolver(this.GetType().Assembly));
            _importAction = _settingsGroupsActionModel.AddAction("import", SR.LabelImport, "ImportToolSmall.png",
                                                                 SR.TooltipImportSettingsMetaData,
                                                                 Import);
            _importAction.Visible = _settingsStore.SupportsImport;

            _settingsPropertiesActionModel = new SimpleActionModel(new ApplicationThemeResourceResolver(this.GetType().Assembly));
            _saveAllAction  = _settingsPropertiesActionModel.AddAction("saveall", SR.LabelSaveAll, "SaveToolSmall.png", () => SaveModifiedSettings(false));
            _editAction     = _settingsPropertiesActionModel.AddAction("edit", SR.LabelEdit, "EditToolSmall.png", () => EditProperty(_selectedSettingsProperty));
            _resetAction    = _settingsPropertiesActionModel.AddAction("reset", SR.LabelReset, "ResetToolSmall.png", () => ResetPropertyValue(_selectedSettingsProperty));
            _resetAllAction = _settingsPropertiesActionModel.AddAction("resetall", SR.LabelResetAll, "ResetAllToolSmall.png", ResetAllPropertyValues);
        }
Ejemplo n.º 8
0
 public AlertViewerComponent()
 {
     _alertTable   = new Table <Alert>();
     _alertActions = new SimpleActionModel(new ResourceResolver(this.GetType().Assembly));
 }
Ejemplo n.º 9
0
        private void AddFixedZoomAction(SimpleActionModel actionModel, int scale)
        {
            string label = String.Format(SR.FormatLabelZoomFixed, scale);

            actionModel.AddAction("fixedzoom" + label, label, null, label, delegate { SetScale(scale); });
        }
        public override void Start()
        {
            var resolver = new ResourceResolver(this.GetType().Assembly);

            _mppsActionHandler = new SimpleActionModel(resolver);

            _stopAction        = _mppsActionHandler.AddAction("stop", SR.TitleStopMpps, "Icons.CheckInToolSmall.png", SR.TitleStopMpps, StopPerformedProcedureStep);
            _discontinueAction = _mppsActionHandler.AddAction("discontinue", SR.TitleDiscontinueMpps, "Icons.DeleteToolSmall.png", SR.TitleDiscontinueMpps, DiscontinuePerformedProcedureStep);
            UpdateActionEnablement();

            if (_orderRef != null)
            {
                Platform.GetService <IModalityWorkflowService>(
                    service =>
                {
                    var mppsRequest  = new ListPerformedProcedureStepsRequest(_orderRef);
                    var mppsResponse = service.ListPerformedProcedureSteps(mppsRequest);

                    _mppsTable.Items.AddRange(mppsResponse.PerformedProcedureSteps);
                    _mppsTable.Sort();
                });
            }

            // create extension editor pages, if any exist
            foreach (IPerformedStepEditorPageProvider provider in (new PerformedStepEditorPageProviderExtensionPoint().CreateExtensions()))
            {
                _editorPages.AddRange(provider.GetPages(new EditorContext(this)));
            }

            // if no editor pages are available via extensions, create the default editor
            if (_editorPages.Count == 0)
            {
                _editorPages.Add(new MppsDocumentationComponent(new EditorContext(this)));

                if (PerformingDocumentationComponentSettings.Default.ShowDicomSeriesTab)
                {
                    _editorPages.Add(new PerformedProcedureDicomSeriesComponent(new EditorContext(this)));
                }
            }


            // if there are multiple pages, need to create a tab container
            if (_editorPages.Count > 1)
            {
                var tabContainer = new TabComponentContainer();
                _detailsPagesHost = new ChildComponentHost(this.Host, tabContainer);
                foreach (var page in _editorPages)
                {
                    tabContainer.Pages.Add(new TabPage(page.Path, page.GetComponent()));
                }
            }
            else
            {
                // don't create a tab container for just one page
                _detailsPagesHost = new ChildComponentHost(this.Host, _editorPages[0].GetComponent());
            }

            // start details pages host
            _detailsPagesHost.StartComponent();

            base.Start();
        }