Esempio n. 1
0
		/// <summary>
		/// Gets a set of exported <see cref="IAction"/>s.
		/// </summary>
		/// <param name="site">The action model site at which the actions should reside.</param>
		/// <param name="mouseInformation">The mouse input when the action model was requested, such as in response to a context menu request.</param>
		/// <returns>A set of exported <see cref="IAction"/>s.</returns>
		public override IActionSet GetExportedActions(string site, IMouseInformation mouseInformation)
		{
			IResourceResolver resolver = new ApplicationThemeResourceResolver(this.GetType(), true);
			string @namespace = typeof(RoiCalloutGraphic).FullName;

			List<IAction> actions = new List<IAction>();
			MenuAction hideAction = new MenuAction(@namespace + ":toggle", new ActionPath(site + "/MenuShowAnalysis", resolver), ClickActionFlags.None, resolver);
			hideAction.GroupHint = new GroupHint("Tools.Measurements.Display");
			hideAction.Label = SR.MenuShowAnalysis;
			hideAction.Checked = this.ShowAnalysis;
			hideAction.Persistent = true;
			hideAction.SetClickHandler(this.ToggleShowAnalysis);
			actions.Add(hideAction);

			if (AllowRename)
			{
				MenuAction renameAction = new MenuAction(@namespace + ":rename", new ActionPath(site + "/MenuRename", resolver), ClickActionFlags.None, resolver);
				renameAction.GroupHint = new GroupHint("Tools.Measurements.Properties");
				renameAction.Label = SR.MenuRename;
				renameAction.Persistent = true;
				renameAction.SetClickHandler(this.Rename);
				actions.Add(renameAction);
			}

			IActionSet actionSet = new ActionSet(actions);

			if (this.ShowAnalysis)
            {
                var analyzerActionSets = GetAnalyzersExportedActions(site, mouseInformation);

                if (analyzerActionSets != null)
                {
                    foreach(var set in analyzerActionSets)
                    {
                        actionSet = actionSet.Union(set);
                    } 
                }
                   
            }

			IActionSet other = base.GetExportedActions(site, mouseInformation);
			if (other != null)
				actionSet = actionSet.Union(other);

			return actionSet;
		}
        public override IActionSet GetExportedActions(string site, ClearCanvas.ImageViewer.InputManagement.IMouseInformation mouseInformation)
        {
            IResourceResolver resolver = new ResourceResolver(GetType(), true);
            var @namespace = GetType().FullName;
            var hideAction = new MenuAction(@namespace + ":toggle", new ActionPath(site + "/MenuSetMarkupColorForUser", resolver), ClickActionFlags.None, resolver);
            hideAction.Label = "Set User Markup Color";
            hideAction.Persistent = true;
            hideAction.SetClickHandler(OpenAimMarkupColorOptions);

            IActionSet actions = new ActionSet(new IAction[] { hideAction });
            var other = base.GetExportedActions(site, mouseInformation);
            if (other != null)
                actions = actions.Union(other);

            return actions;
        }