コード例 #1
0
            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();
            }
コード例 #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;
            });
        }
コード例 #3
0
 public DisconnectedState(ActivityMonitorComponent component)
     : base(component)
 {
 }
コード例 #4
0
 protected ConnectionState(ActivityMonitorComponent component)
 {
     Component = component;
 }