public void BuildMenu(IMenuBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder
            .AddItem("/Edit/Select All", "")
            .SetPlacement(0, 10);

            builder
            .AddItem("/File/New Project...", "")
            .SetPlacement(0, 10);

            builder
            .AddItem("/File/Advanced Mode", "")
            .SetPlacement(10, 10)
            .SetCheckbox(false, true);

            builder
            .AddItem("Help/About...", "")
            .SetPlacement(100, 100)
            .SetCommand(new Command(() =>
            {
                _messageBoxManager.Show("About",
                                        "MN.Shell Demo Application" + Environment.NewLine + "Version 0.1.0", MessageBoxType.Info);
            }));
        }
        public void Build(IMenuBuilder builder, ObjectsViewContext context)
        {
            if (context.SelectedObjects.Count() != 1)
            {
                return;
            }

            var dataObjects = context.SelectedObjects.ToArray();

            if (dataObjects.Length != 1)
            {
                return;
            }

            _selected = dataObjects.FirstOrDefault();
            if (_selected == null)
            {
                return;
            }
            if (!_selected.Type.IsMountable)
            {
                return;
            }

            var icon = IconLoader.GetIcon(@"/Resources/menu_icon.svg");

            builder.AddItem(ADD_INFORMATION_TO_PILOT, 1)
            .WithHeader("Д_обавить информацию из файлов")
            .WithIcon(icon);
            builder.AddItem(ADD_DOC_TO_PILOT, 2)
            .WithHeader("Д_обавить документы")
            .WithIcon(icon);
        }
        public void BuildMenu(IMenuBuilder builder)
        {
            if (builder == null)
            {
                throw new ArgumentNullException(nameof(builder));
            }

            builder
            .AddItem("File", Resources.MenuFile)
            .SetPlacement(0, 10);

            builder
            .AddItem("Edit", Resources.MenuEdit)
            .SetPlacement(0, 20);

            builder
            .AddItem("View", Resources.MenuView)
            .SetPlacement(0, 30);

            builder
            .AddItem("Help", Resources.MenuHelp)
            .SetPlacement(0, 40);

            builder
            .AddItem("File/Exit", Resources.MenuExit)
            .SetPlacement(100, 100)
            .SetCommand(new Command(() => _applicationContext.RequestApplicationExit()));

            builder
            .AddItem("View/Theme", Resources.MenuTheme)
            .SetPlacement(30, 10);

            foreach (var baseColors in _colorSchemeLoader.AvailableBaseColors)
            {
                int groupOrder = 0;

                builder
                .AddItem($"View/Theme/{baseColors.Name}", baseColors.LocalizedName)
                .SetPlacement(10, groupOrder++)
                .SetCommand(new Command(() => _colorSchemeLoader.LoadBaseColors(baseColors)));
            }

            builder
            .AddItem("View/Accent", Resources.MenuAccent)
            .SetPlacement(30, 20);

            foreach (var accentColors in _colorSchemeLoader.AvailableAccentColors)
            {
                int groupOrder = 0;

                builder
                .AddItem($"View/Accent/{accentColors.Name}", accentColors.LocalizedName)
                .SetPlacement(10, groupOrder++)
                .SetCommand(new Command(() => _colorSchemeLoader.LoadAccentColors(accentColors)));
            }
        }
Exemple #4
0
        public void Build(IMenuBuilder builder, MainViewContext context)
        {
            var item = builder.AddItem("ObjectInfo", 1).WithHeader("Object Info");

            item.WithSubmenu().AddItem(SHOW_SUB_MENU, 0).WithHeader("Show");
            item.WithSubmenu().AddItem(GO_SUB_MENU, 0).WithHeader("Go");
        }
        public void Build(IMenuBuilder builder, ObjectsViewContext context)
        {
            var itemNames   = builder.ItemNames.ToList();
            var insertIndex = itemNames.IndexOf(ShowSharingSettingsName);

            builder.AddItem(AnnulRecursiveName, insertIndex++)
            .WithHeader(AnnulRecursiveHeader);
            builder.AddSeparator(insertIndex);
        }
Exemple #6
0
        public void Build(IMenuBuilder builder, ObjectsViewContext context)
        {
            if (context.IsContext)
            {
                return;
            }

            var item = builder.AddItem(SHOW_OBJECTS_TREE_MENU_ITEM_NAME, builder.Count);

            item.WithHeader("Show Objects Tree");
        }
Exemple #7
0
        public void Build(IMenuBuilder builder, ObjectsViewContext context)
        {
            var settings = NinjectCommon.Kernel.Get <Settings.Settings>();

            _currentObject = context?.SelectedObjects
                             .FirstOrDefault(x => settings.StartTypes.Any(t => x.Type.Name.Equals(t.Type)))?.MapToProjectSection();
            if (_currentObject != null)
            {
                var menu = builder.AddItem(commands[0], 4).WithHeader(commandsName[0]);
                for (int i = 1; i < 4; i++)
                {
                    menu.WithSubmenu().AddItem(commands[i], i - 1).WithHeader(commandsName[i]);
                }
                NinjectCommon.Kernel.Rebind <ProjectSection>().ToMethod(c => _currentObject).InSingletonScope();
                InitializeFolderRemark();
            }
        }
Exemple #8
0
        //public void OnToolbarItemClick(string name, ObjectsViewContext context)
        //{
        //    if (context.SelectedObjects.Count() > 1 || context.SelectedObjects.Count() == 0) return;
        //    IDataObject obj = context.SelectedObjects.First();
        //    DialogService.ShowInfo(obj, _objectsRepository, _fileProvider, _tabServiceProvider);
        //}

        //public void OnToolbarItemClick(string name, TasksViewContext context)
        //{
        //    if (context.SelectedTasks.Count() > 1 || context.SelectedTasks.Count() == 0) return;
        //    IDataObject obj = context.SelectedTasks.First().ToDataObject();
        //    DialogService.ShowInfo(obj, _objectsRepository, _fileProvider, _tabServiceProvider);
        //}

        private void AddItem(IMenuBuilder builder)
        {
            builder.AddItem("objectInfo", 0).WithHeader("Информация об объекте");
        }
Exemple #9
0
 public void Build(IMenuBuilder builder, SystemTrayContext context)
 {
     builder.AddItem("ChangeFilesMonitor", 0).WithHeader(PLUGIN_TITLE);
 }