Esempio n. 1
0
        private ClickAction AddActionHelper(object key, string displayName, string icon, string tooltip, ClickHandlerDelegate clickHandler, ISpecification permissionSpec)
        {
            Platform.CheckForNullReference(key, "key");

            var action = new ClickAction(displayName, MakePath(displayName), ClickActionFlags.None, _resolver)
            {
                Tooltip = tooltip,
                Label   = displayName
            };

            if (icon != null)
            {
                action.IconSet = new IconSet(icon, icon, icon);
            }

            if (clickHandler != null)
            {
                action.SetClickHandler(clickHandler);
            }
            if (permissionSpec != null)
            {
                action.SetPermissibility(permissionSpec);
            }

            this.InsertAction(action);

            _actions[key] = action;

            return(action);
        }
		private IAction CreateAction(TransferSyntax syntax, IResourceResolver resolver)
		{
		    var action = new ClickAction(syntax.UidString,
		                                 new ActionPath("dicomstudybrowser-contextmenu/Change Transfer Syntax/" + syntax.ToString(), resolver),
		                                 ClickActionFlags.None, resolver) {Enabled = Enabled};

		    this.EnabledChanged += (sender, args) => action.Enabled = Enabled;

            action.SetClickHandler(() => ChangeToSyntax(syntax));
			action.Label = syntax.ToString();
			return action;
		}
Esempio n. 3
0
		private ClickAction AddActionHelper(object key, string displayName, string icon, string tooltip, ClickHandlerDelegate clickHandler, ISpecification permissionSpec)
		{
			Platform.CheckForNullReference(key, "key");

			var action = new ClickAction(displayName, MakePath(displayName), ClickActionFlags.None, _resolver)
			             	{
			             		Tooltip = tooltip,
			             		Label = displayName
			             	};
			if (icon != null)
				action.IconSet = new IconSet(icon, icon, icon);

			if (clickHandler != null)
			{
				action.SetClickHandler(clickHandler);
			}
			if (permissionSpec != null)
			{
				action.SetPermissibility(permissionSpec);
			}

			this.InsertAction(action);

			_actions[key] = action;

			return action;
		}