using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DynamicLink
{
    public static class Launcher
    {
        public static void StartModule(string name, string args = "")
        {
            if (Modules.Items.Count == 0) Modules.CollectData();
            Modules.ExecuteModule(name, args);
        }

        public static void About()
        {
            new AboutWindow().ShowDialog();
        }

        public static string FindHelpFiles()
        {
            string[] possible_paths = { 
                Environment.CurrentDirectory + "\\documentation\\index.xml",
                Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\documentation\\index.xml" };

            foreach (var i in possible_paths)
                if (System.IO.File.Exists(i)) return i; 
                
            // Haven't found anything? Abandon
            return "";
        }
    }
}