public WorkItemActionModel(IItemCollection <WorkItem> workItems, ActivityMonitorComponent owner)
                : base(new ApplicationThemeResourceResolver(typeof(ActivityMonitorComponent).Assembly, new ApplicationThemeResourceResolver(typeof(CrudActionModel).Assembly)))
            {
                _workItems = workItems;
                _owner     = owner;
                if (PermissionsHelper.IsInRole(AuthorityTokens.ActivityMonitor.WorkItems.Stop))
                {
                    this.CancelAction = AddAction("cancel", SR.MenuStopWorkItem, "CancelToolSmall.png", SR.TooltipStopWorkItem, CancelSelectedWorkItems);
                }

                if (PermissionsHelper.IsInRole(AuthorityTokens.ActivityMonitor.WorkItems.Restart))
                {
                    this.RestartAction = AddAction("restart", SR.MenuRestartWorkItem, "RestartToolSmall.png", SR.TooltipRestartWorkItem, RestartSelectedWorkItems);
                }

                if (PermissionsHelper.IsInRole(AuthorityTokens.ActivityMonitor.WorkItems.Delete))
                {
                    this.DeleteAction = AddAction("delete", SR.MenuDeleteWorkItem, "DeleteToolSmall.png", SR.TooltipDeleteWorkItem, DeleteSelectedWorkItems);
                }

                if (PermissionsHelper.IsInRole(AuthorityTokens.ActivityMonitor.WorkItems.Prioritize))
                {
                    this.StatAction = AddAction("stat", SR.MenuStatWorkItem, "StatToolSmall.png", SR.TooltipStatWorkItem, StatSelectedWorkItems);
                }

                UpdateActionEnablement();
            }
Exemplo n.º 2
0
        public static void Show(IDesktopWindow desktopWindow)
        {
            if (_workspace != null)
            {
                _workspace.Activate();
                return;
            }

            if (!PermissionsHelper.IsInRole(AuthorityTokens.ActivityMonitor.View))
            {
                desktopWindow.ShowMessageBox(SR.WarningActivityMonitorPermission, MessageBoxActions.Ok);
                return;
            }

            var component = new ActivityMonitorComponent();

            _workspace         = ApplicationComponent.LaunchAsWorkspace(desktopWindow, component, SR.TitleActivityMonitor);
            _workspace.Closed += ((sender, args) =>
            {
                _workspace = null;
            });
        }
 public DisconnectedState(ActivityMonitorComponent component)
     : base(component)
 {
 }
 protected ConnectionState(ActivityMonitorComponent component)
 {
     Component = component;
 }