Ejemplo n.º 1
0
        public void Initalize()
        {
            var tasksSection = new MenuSection <ItemCommand <ClientViewModel> >();

            var tasksSubMenu = new NavigationalEntry <ItemCommand <ClientViewModel> >
            {
                Header = Tx.T("TasksInfrastructure:CreateTask.Commands", 2), IsOrdered = true, Icon = _icons.SelectCommandColumn
            };

            InitializeCommands(tasksSubMenu);
            tasksSection.Add(tasksSubMenu);

            var createTaskCommand = new ItemCommand <ClientViewModel>
            {
                Header  = Tx.T("TasksInfrastructure:CreateTask"),
                Icon    = _icons.NewCatalog,
                Command = new DelegateCommand <ClientViewModel>(client => CreateTaskCommand(new List <ClientViewModel> {
                    client
                })),
                MultipleCommand = new DelegateCommand <IList <ClientViewModel> >(CreateTaskCommand)
            };

            tasksSection.Add(createTaskCommand);

            _clientsContextMenu.Add(tasksSection);
        }
Ejemplo n.º 2
0
 public FileExplorerListDirectoryContextMenu()
 {
     Add(Section1 = new MenuSection <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >());
     Section1.Add(Section1Path = new NavigationalEntry <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >());
     Add(Section2 = new MenuSection <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >());
     Section2.Add(Section2Archive = new NavigationalEntry <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >());
     Add(Section3 = new MenuSection <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >());
     Add(Section4 = new MenuSection <ContextDiItemsCommand <DirectoryViewModel, EntryViewModel, FileExplorerViewModel> >());
 }
Ejemplo n.º 3
0
 public ClientsContextMenu(ILibraryIcons icons)
 {
     Add(SystemCommands = new NavigationalEntry <ItemCommand <ClientViewModel> >(isOrdered: true)
     {
         Header = Tx.T("Menu.System"),
         Icon   = icons.ComputerSystem
     });
     Add(InteractionCommands = new NavigationalEntry <ItemCommand <ClientViewModel> >(isOrdered: true)
     {
         Header = Tx.T("Menu.UserInteraction"),
         Icon   = icons.UserVoice
     });
     Add(SurveillanceCommands = new NavigationalEntry <ItemCommand <ClientViewModel> >(isOrdered: true)
     {
         Header = Tx.T("Menu.Surveillance"),
         Icon   = icons.HideTimeline
     });
     Add(ClientCommands = new MenuSection <ItemCommand <ClientViewModel> >());
 }
Ejemplo n.º 4
0
        private void InitializeCommands(NavigationalEntry <ItemCommand <ClientViewModel> > rootEntry)
        {
            var navigationalEntries = new Dictionary <string, NavigationalEntry <ItemCommand <ClientViewModel> > >();

            foreach (var commandDescription in _commandDescriptions)
            {
                var serviceNamespace = ServiceNamespace.Parse(commandDescription.Namespace);
                var menuEntry        = rootEntry;

                foreach (var relativeSegment in serviceNamespace.GetRelativeSegments())
                {
                    var lastEntry = menuEntry;

                    if (navigationalEntries.TryGetValue(relativeSegment, out menuEntry))
                    {
                        continue;
                    }

                    menuEntry = new NavigationalEntry <ItemCommand <ClientViewModel> >(true)
                    {
                        Header = ServiceNamespace.TranslateSegment(relativeSegment)
                    };

                    navigationalEntries.Add(relativeSegment, menuEntry);
                    lastEntry.Add(menuEntry);
                }

                menuEntry.Add(new ItemCommand <ClientViewModel>
                {
                    Header  = commandDescription.Name,
                    Icon    = commandDescription.Icon,
                    Command = new DelegateCommand <ClientViewModel>(x => ExecuteCommand(new List <ClientViewModel> {
                        x
                    }, commandDescription)),
                    MultipleCommand = new DelegateCommand <IList <ClientViewModel> >(x => ExecuteCommand(x, commandDescription))
                });
            }
        }
Ejemplo n.º 5
0
 public FileExplorerContextMenu()
 {
     Add(Section1    = new MenuSection <ContextCommand <FileExplorerViewModel> >());
     Add(Section2    = new MenuSection <ContextCommand <FileExplorerViewModel> >());
     Add(Section3New = new NavigationalEntry <ContextCommand <FileExplorerViewModel> >());
 }