/// <summary>
        /// Initialize the component.
        /// </summary>
        public override void Start()
        {
            _calendar = new Calendar();

            _appointmentDate = Platform.Time;   // init to current time

            // define the structure of the appointments table
            _appointments = new Table <CalendarEvent>();
            _appointments.Columns.Add(new TableColumn <CalendarEvent, string>(SR.AppointmentTableDate,
                                                                              delegate(CalendarEvent e) { return(Format.Date(e.StartTime)); }));
            _appointments.Columns.Add(new TableColumn <CalendarEvent, string>(SR.AppointmentTableComment,
                                                                              delegate(CalendarEvent e) { return(e.Description); }));

            // create extension tools and action models
            _extensionTools = new ToolSet(new SchedulingToolExtensionPoint(), new SchedulingToolContext(this));
            _menuModel      = ActionModelRoot.CreateModel(this.GetType().FullName, "scheduling-appointments-contextmenu", _extensionTools.Actions);
            _toolbarModel   = ActionModelRoot.CreateModel(this.GetType().FullName, "scheduling-appointments-toolbar", _extensionTools.Actions);

            // initialize patient info from active workspace
            UpdatePatientInfo(this.Host.DesktopWindow.ActiveWorkspace);

            // subscribe to desktop window for changes in active workspace
            this.Host.DesktopWindow.Workspaces.ItemActivationChanged += Workspaces_ItemActivationChanged;


            base.Start();
        }
        public override void Start()
        {
            // TODO prepare the component for its live phase
            base.Start();

            // initialize the list object that will display the shreds
            _shredCollection = new Table <Shred>();
            _shredCollection.Columns.Add(new TableColumn <Shred, string>("Shreds",
                                                                         delegate(Shred shred) { return(shred.Name); }
                                                                         ));
            _shredCollection.Columns.Add(new TableColumn <Shred, string>("Status",
                                                                         delegate(Shred shred) { return((shred.IsRunning) ? "Running" : "Stopped"); }
                                                                         ));

            // refresh the state of the Shred Host and shreds
            Refresh();

            _toolSet          = new ToolSet(new ShredHostClientToolExtensionPoint(), new ShredHostClientToolContext(this));
            _toolbarModel     = ActionModelRoot.CreateModel(this.GetType().FullName, "shredhostclient-toolbar", _toolSet.Actions);
            _contextMenuModel = ActionModelRoot.CreateModel(this.GetType().FullName, "shredhostclient-contextmenu", _toolSet.Actions);

            _refreshTask = new BackgroundTask(delegate(IBackgroundTaskContext context)
            {
                while (true)
                {
                    System.Threading.Thread.Sleep(2000);
                    Refresh();
                }
            }, true
                                              );

            _refreshTask.Run();
        }
예제 #3
0
        /// <summary>
        /// Override of <see cref="ApplicationComponent.Start"/>
        /// </summary>
        /// <remarks>
        /// For internal Framework use only.
        /// </remarks>
        public override void Start()
        {
            base.Start();

            _uiThreadSynchronizationContext = SynchronizationContext.Current;

            _contextMenuFilter = _setupHelper.GetContextMenuFilter() ?? ViewerActionFilter.Null;
            _contextMenuFilter.SetImageViewer(this);

            _toolbarFilter = _setupHelper.GetToolbarFilter() ?? ViewerActionFilter.Null;
            _toolbarFilter.SetImageViewer(this);

            _toolSet = new ToolSet(CreateTools(), CreateToolContext());

            // since the keyboard action model is otherwise never used, we explicitly invoke it here to apply the persisted action model values to the actions
            ActionModelRoot.CreateModel(ActionsNamespace, KeyboardSite, _toolSet.Actions);

            foreach (ITool tool in _toolSet.Tools)
            {
                _shortcutManager.RegisterImageViewerTool(tool);
            }

            this.backgroundWorker = new BackgroundWorker();
            this.backgroundWorker.WorkerSupportsCancellation = true;
            this.backgroundWorker.DoWork += new System.ComponentModel.DoWorkEventHandler(this.backgroundWorker_DoWork);
        }
 /// <summary>
 /// Called by the host to initialize the application component.
 /// </summary>
 public override void Start()
 {
     // TODO prepare the component for its live phase
     base.Start();
     _toolSet          = new ToolSet(new ImageBrowserToolExtensionPoint(), new ImageBrowserToolContext(this));
     _toolbarModel     = ActionModelRoot.CreateModel(this.GetType().FullName, "dicomImageBrowser-toolbar", _toolSet.Actions);
     _contextMenuModel = ActionModelRoot.CreateModel(this.GetType().FullName, "dicomImageBrowser-contextmenu", _toolSet.Actions);
 }
        public override void Start()
        {
            _toolSet      = new ToolSet(_toolExtensionPoint, new ToolContext(this));
            _toolbarModel = ActionModelRoot.CreateModel(_toolsNamespace, _toolbarSite, _toolSet.Actions);
            _menuModel    = ActionModelRoot.CreateModel(_toolsNamespace, _menuSite, _toolSet.Actions);

            base.Start();
        }
예제 #6
0
        public override void Start()
        {
            base.Start();

            _toolSet          = new ToolSet(new DicomEditorToolExtensionPoint(), new DicomEditorToolContext(this));
            _toolbarModel     = ActionModelRoot.CreateModel(this.GetType().FullName, "dicomeditor-toolbar", _toolSet.Actions);
            _contextMenuModel = ActionModelRoot.CreateModel(this.GetType().FullName, "dicomeditor-contextmenu", _toolSet.Actions);
        }
        public override void Start()
        {
            base.Start();

            _toolSet          = new ToolSet(new ServerTreeToolExtensionPoint(), new ServerTreeToolContext(this));
            _toolbarModel     = ActionModelRoot.CreateModel(this.GetType().FullName, "servertree-toolbar", _toolSet.Actions);
            _contextMenuModel = ActionModelRoot.CreateModel(this.GetType().FullName, "servertree-contextmenu", _toolSet.Actions);
        }
        /// <summary>
        /// Gets the context menu <see cref="ActionModelNode"/> based on the current state of the mouse.
        /// </summary>
        public ActionModelNode GetContextMenuModel(IMouseInformation mouseInformation)
        {
            if (string.IsNullOrEmpty(this.Site))
            {
                return(null);
            }

            return(ActionModelRoot.CreateModel(this.Namespace, this.Site, ((IExportedActionsProvider)this).GetExportedActions(this.Site, mouseInformation)));
        }
        /// <summary>
        /// Gets the context menu <see cref="ActionModelNode"/> based on the current state of the mouse.
        /// </summary>
        public virtual ActionModelNode GetContextMenuModel(IMouseInformation mouseInformation)
        {
            IActionSet actions = this.GetExportedActions("basicgraphic-menu", mouseInformation);

            if (actions == null || actions.Count == 0)
            {
                return(null);
            }
            return(ActionModelRoot.CreateModel(this.ContextMenuNamespace, "basicgraphic-menu", actions));
        }
예제 #10
0
        /// <summary>
        /// Creates an action model that is the union of the tools for this component plus
        /// the tools for the currently selected folder explorer.
        /// </summary>
        /// <param name="site"></param>
        /// <returns></returns>
        private ActionModelNode CreateActionModel(string site)
        {
            var allActions        = _toolSet.Actions;
            var explorerComponent = _selectedFolderExplorer as IApplicationComponent;

            if (explorerComponent != null)
            {
                allActions = allActions.Union(explorerComponent.ExportedActions);
            }
            return(ActionModelRoot.CreateModel(this.GetType().FullName, site, allActions));
        }
예제 #11
0
        public override void Start()
        {
            base.Start();

            var tools = new ArrayList(new MediaBrowserExplorerToolExtensionPoint().CreateExtensions());

            ToolSet = new ToolSet(tools, new MediaBrowserExplorerToolContext(this));

            _toolbarModel     = ActionModelRoot.CreateModel(GetType().FullName, "explorermedia-toolbar", _toolSet.Actions);
            _contextMenuModel = ActionModelRoot.CreateModel(GetType().FullName, "explorermedia-contextmenu", _toolSet.Actions);
        }
예제 #12
0
        public virtual ActionModelNode GetContextMenuModel(IMouseInformation mouseInformation)
        {
            const string actionSite = "dicomgraphic-menu";
            var          actions    = GetExportedActions(actionSite, mouseInformation);

            if (actions == null || actions.Count == 0)
            {
                return(null);
            }
            return(ActionModelRoot.CreateModel(ContextMenuNamespace, actionSite, actions));
        }
예제 #13
0
        public override void Start()
        {
            base.Start();
            this.InitializeNodePropertiesComponent();

            _toolSet                = new ToolSet(new ActionModelConfigurationComponentToolExtensionPoint(), new ActionModelConfigurationComponentToolContext(this));
            _toolbarActionModel     = ActionModelRoot.CreateModel(this.GetType().FullName, _tolbarActionSite, _toolSet.Actions);
            _contextMenuActionModel = ActionModelRoot.CreateModel(this.GetType().FullName, _contextMenuActionSite, _toolSet.Actions);

            _actionModelTreeRoot.NodeValidationRequested += OnActionModelTreeRootNodeValidationRequested;
            _actionModelTreeRoot.NodeValidated           += OnActionModelTreeRootNodeValidated;
        }
예제 #14
0
        public override void Start()
        {
            // Instantiate all the tools that are marked with the
            // WebBrowserToolExtensionPoint attribute (e.g. LaunchGoogleTool)
            _toolSet = new ToolSet(new XnatWebBrowserToolExtensionPoint(), new WebBrowserToolContext(this));

            // Create the action model so that the view can read it and create
            // the appropriate toolbar items.
            _toolbarModel = ActionModelRoot.CreateModel(GetType().FullName, "webbrowser-toolbar", _toolSet.Actions);

            base.Start();
        }
예제 #15
0
        public override void Start()
        {
            InitializeTable();
            BlockingOperation.Run(RefreshInternal);
            _seriesTable.Sort(new TableSortParams(_seriesTable.Columns[0], false));

            _toolSet            = new ToolSet(new SeriesDetailsToolExtensionPoint(), new SeriesDetailsToolContext(this));
            _toolbarActionModel = ActionModelRoot.CreateModel(GetType().FullName, SeriesDetailsTool.ToolbarActionSite, _toolSet.Actions);
            _contextActionModel = ActionModelRoot.CreateModel(GetType().FullName, SeriesDetailsTool.ContextMenuActionSite, _toolSet.Actions);

            base.Start();
        }
예제 #16
0
        /// <summary>
        /// Called by the host to initialize the application component.
        /// </summary>
        public override void Start()
        {
            base.Start();

            _resolver = new ApplicationThemeResourceResolver(GetType(), true);
            ActionSet  deleteToolActions = new ActionSet(GetDeleteActions());
            var        toolActions       = CreateToolActions();
            IActionSet allActions        = toolActions != null?toolActions.Union(deleteToolActions) : deleteToolActions;

            _toolbarModel     = ActionModelRoot.CreateModel(ToolActionsNamespace, _toolbarSite, allActions);
            _contextMenuModel = ActionModelRoot.CreateModel(ToolActionsNamespace, _menuSite, allActions);

            _items.BindingList.ListChanged += OnBindingListChanged;
        }
        private static IClickAction FindClickAction(KeyboardButtonShortcut shortcut, string @namespace, string site, IActionSet actionSet)
        {
            var actions = ActionModelRoot.CreateModel(@namespace, site, actionSet).GetActionsInOrder();

            foreach (var action in actions)
            {
                var clickAction = action as IClickAction;
                if (clickAction != null && shortcut.Equals(clickAction.KeyStroke))
                {
                    return(clickAction);
                }
            }

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

            var tools = new ArrayList(new StudyBrowserToolExtensionPoint().CreateExtensions());

            tools.Add(new FilterDuplicateStudiesTool(this));
            _toolSet = new ToolSet(tools, new StudyBrowserToolContext(this));

            _toolbarModel     = ActionModelRoot.CreateModel(GetType().FullName, "dicomstudybrowser-toolbar", _toolSet.Actions);
            _contextMenuModel = ActionModelRoot.CreateModel(GetType().FullName, "dicomstudybrowser-contextmenu", _toolSet.Actions);

            _searchResultColumnOptions = SearchResult.ColumnOptions;

            DicomExplorerConfigurationSettings.Default.PropertyChanged += OnConfigurationSettingsChanged;
        }
        public override void Start()
        {
            _contextMenuFilter = _setupHelper.GetContextMenuFilter() ?? ViewerActionFilter.Null;
            _contextMenuFilter.SetImageViewer(this);

            _toolSet = new ToolSet(CreateTools(), CreateToolContext());

            // since the keyboard action model is otherwise never used, we explicitly invoke it here to apply the persisted action model values to the actions
            ActionModelRoot.CreateModel(ActionsNamespace, PrintKeyboardSite, _toolSet.Actions);

            foreach (ITool tool in _toolSet.Tools)
            {
                _shortcutManager.RegisterImageViewerTool(tool);
            }
            base.Start();
        }
예제 #20
0
        /// <summary>
        /// Builds the action model for the specified site.
        /// </summary>
        private ActionModelNode BuildActionModel(string site)
        {
            string @namespace = typeof(DesktopWindow).FullName;

            IActionSet actions = this.DesktopTools.Actions;

            if (this.ActiveWorkspace != null)
            {
                actions = actions.Union(this.Workspaces.ActiveWorkspace.Actions);
                if (this.ActiveWorkspace.Component is IApplicationComponent)
                {
                    @namespace = ((IApplicationComponent)this.ActiveWorkspace.Component).GlobalActionsNamespace;
                }
            }

            return(ActionModelRoot.CreateModel(@namespace, site, actions));
        }
예제 #21
0
        public StudyFilterComponentPanel(StudyFilterComponent component) : this()
        {
            _component = component;
            _component.FilterPredicatesChanged += new EventHandler(_component_FilterPredicatesChanged);

            ActionModelRoot toolbarActions = ActionModelRoot.CreateModel("ClearCanvas.ImageViewer.Utilities.StudyFilters.View.WinForms", StudyFilterTool.DefaultToolbarActionSite, _component.ExportedActions);

            ToolStripBuilder.ToolStripBuilderStyle defaultStyle = new ToolStripBuilder.ToolStripBuilderStyle();
            ToolStripBuilder.ToolStripBuilderStyle myStyle      = new ToolStripBuilder.ToolStripBuilderStyle(ToolStripItemDisplayStyle.ImageAndText, defaultStyle.ToolStripAlignment, defaultStyle.TextImageRelation);
            ToolStripBuilder.BuildToolbar(_toolbar.Items, toolbarActions.ChildNodes, myStyle);

            _tableView.Table       = component.Table;
            _tableView.MultiSelect = true;
            _tableView.ColumnFilterMenuStripClosed    += new EventHandler(_tableView_ColumnFilterMenuStripClosed);
            _tableView.ContextActionModelDelegate      = this.GetContextMenuModel;
            _tableView.ColumnFilterActionModelDelegate = this.GetColumnFilterMenuModel;
            _tableView.ReadOnly = true;
        }
예제 #22
0
        /// <summary>
        /// Called by the host to initialize the application component.
        /// </summary>
        public override void Start()
        {
            base.Start();

            ClipboardToolContext toolContext = new ClipboardToolContext(this);

            _toolSet = new ToolSet(new ClipboardToolExtensionPoint(), toolContext);

            _resolver = new ApplicationThemeResourceResolver(GetType(), true);
            ActionSet  toolActions       = new ActionSet(_toolSet.Actions);
            ActionSet  deleteToolActions = new ActionSet(GetDeleteActions());
            IActionSet allActions        = toolActions.Union(deleteToolActions);

            _toolbarModel     = ActionModelRoot.CreateModel(typeof(ClipboardComponent).FullName, _toolbarSite, allActions);
            _contextMenuModel = ActionModelRoot.CreateModel(typeof(ClipboardComponent).FullName, _menuSite, allActions);

            _items.BindingList.ListChanged += OnBindingListChanged;
        }
예제 #23
0
        /// <summary>
        /// Constructs a <see cref="GalleryComponent"/> with the specified data source, automatically adding the actions of
        /// <see cref="GalleryToolExtensionPoint"/>s at the specified action sites.
        /// </summary>
        /// <param name="dataSource">An <see cref="IBindingList"/> of <see cref="IGalleryItem"/>s.</param>
        /// <param name="toolbarSite">The site for toolbar actions.</param>
        /// <param name="contextMenuSite">The site for context menu actions.</param>
        public GalleryComponent(IBindingList dataSource, string toolbarSite, string contextMenuSite)
        {
            _dataSource = dataSource;

            if (toolbarSite != null || contextMenuSite != null)
            {
                GalleryToolExtensionPoint xp = new GalleryToolExtensionPoint();
                ToolContext context          = new ToolContext(this);
                ToolSet     ts = new ToolSet(xp, context);

                if (contextMenuSite != null)
                {
                    _menuModel = ActionModelRoot.CreateModel(typeof(GalleryComponent).FullName, contextMenuSite, ts.Actions);
                }
                if (toolbarSite != null)
                {
                    _toolbarModel = ActionModelRoot.CreateModel(typeof(GalleryComponent).FullName, toolbarSite, ts.Actions);
                }

                _toolSet = ts;
            }
        }
 public ActionModelNode GetContextMenuActionModel(IStudyItem item, StudyFilterColumn column)
 {
     _toolContext.SetActiveCell(item, column);
     return(ActionModelRoot.CreateModel(this.GetType().FullName, StudyFilterTool.DefaultContextMenuActionSite, _actions));
 }