Пример #1
0
        private SelectableAction[] GetActions(string path)
        {
            var actions = new List <SelectableAction>
            {
                new SelectableAction("Open", () => FolderService.OpenLocation(path)),
                new SelectableAction("Terminal", () => TerminalService.OpenTerminal(path)),
            };

            var hasGit = GitService.TryGetRemoteGitLocation(path, out string uri);

            if (hasGit)
            {
                actions.Add(new SelectableAction("Web", () => StartProgramService.StartProgram(uri)));
            }

            foreach (var type in m_programTypesToStart)
            {
                actions.Add(new SelectableAction(type, () => StartProgramService.StartProgramOfType(type, path, true)));
            }

            foreach (var type in m_programTypesTopFolderToStart)
            {
                actions.Add(new SelectableAction(type, () => StartProgramService.StartProgramOfType(type, path, true)));
            }

            return(actions.ToArray());
        }
Пример #2
0
 public Task <ConcurrentBag <SelectableItem> > GetItems()
 {
     return(Task.FromResult(new ConcurrentBag <SelectableItem>
     {
         new SelectableItem("OpenRepo - Edit config",
                            () => new SelectableAction[]
         {
             new SelectableAction("Edit", () => StartProgramService.StartProgram(ConfigurationService.ConfigurationPath))
         }),
         new SelectableItem("OpenRepo - Create issue",
                            () => new SelectableAction[]
         {
             new SelectableAction("Open", () => StartProgramService.StartProgram("https://github.com/Illedan/openrepo/issues/new?title=Unhandled+Exception+in+Version:+" +
                                                                                 OpenRepoVersionService.GetCurrentVersion() +
                                                                                 "&body=" + HttpUtility.UrlEncode(LogService.Message)))
         }),
         new SelectableItem("OpenRepo - Update",
                            () => new SelectableAction[]
         {
             new SelectableAction("Open", () => TerminalService.Instance.Term("dotnet tool update openrepo -g", ToolBox.Bridge.Output.Hidden))
         }),
     }));
 }
Пример #3
0
        private SelectableAction[] GetActions(string path)
        {
            var actions = new List <SelectableAction>
            {
                new SelectableAction("Open", () => FolderService.OpenLocation(path)),
            };

            //if (false) // Disable until I can figure it out
            //{
            //    actions.Add(new SelectableAction("Terminal", () => TerminalService.OpenTerminal(path)));
            //}

            var hasGit = GitService.TryGetRemoteGitLocation(path, out string uri);

            if (hasGit)
            {
                actions.Add(new SelectableAction("Web", () => StartProgramService.StartProgram(uri)));
            }

            foreach (var type in m_programTypesToStart)
            {
                actions.Add(new SelectableAction(type, () => StartProgramService.StartProgramOfType(type, path, true)));
            }

            foreach (var type in m_programTypesTopFolderToStart)
            {
                actions.Add(new SelectableAction(type, () => StartProgramService.StartProgramOfType(type, path, false)));
            }

            foreach (var script in m_scripts)
            {
                actions.Add(new SelectableAction(script.Key, () => StartProgramService.RunScript(script, path)));
            }

            return(actions.ToArray());
        }
Пример #4
0
        public Task <ConcurrentBag <SelectableItem> > GetItems()
        {
            var bag = new ConcurrentBag <SelectableItem>();

            bag.Add(new SelectableItem(m_key, () => new SelectableAction[] { new SelectableAction("Open", () => StartProgramService.StartProgram(m_value)) }));
            return(Task.FromResult(bag));
        }