示例#1
0
 public ToolItem(ToolListConfiguration model)
 {
     this.Icon        = ShellIcon.GetIconFor(string.IsNullOrEmpty(model.Icon) ? model.Path : model.Icon);
     this.Model       = model;
     this.Header      = model.Name;
     this.Description = model.Path == null ? null : model.Path;
     this.IsUac       = model.AsAdmin;
 }
示例#2
0
        private void SetTools()
        {
            if (this.tools != null)
            {
                return;
            }

            this.tools = new List <MenuItem>();
            var configuredTools = this.configService.GetCurrentConfiguration().Packages.Tools;

            foreach (var item in configuredTools)
            {
                this.tools.Add(new MenuItem
                {
                    Command = MsixHeroRoutedUICommands.RunTool,
                    Icon    = new Image {
                        Source = ShellIcon.GetIconFor(string.IsNullOrEmpty(item.Icon) ? item.Path : item.Icon)
                    },
                    Header           = item.Name,
                    CommandParameter = item
                });
            }
        }