Пример #1
0
        public frmMain(DirectoryInfo XBMC_ROOT, Preferences p)
        {
            InitializeComponent();

            xbmc = XBMC_ROOT;
            preferences = p;
        }
Пример #2
0
        public frmPrefs(Preferences p, List<string> languages)
        {
            InitializeComponent();
            preferences = p;

            preferences.Restore();

            foreach (string language in languages)
            {
                if (language != "English")
                lsbAllLanguages.Items.Add(language);
            }

            foreach (string language in preferences.LoadOnStartup)
            {
                lsbOnStartup.Items.Add(language);
            }

            txtFolder.Text = preferences.RootFolder;
        }
Пример #3
0
        static void Main(string[] args)
        {
            Preferences prefs = new Preferences();
            prefs.Restore();

            string xbmc = Environment.CurrentDirectory;

            if (args.Length == 0)
            {
                string env = Environment.GetEnvironmentVariable("XBMC_ROOT");
                if (env == null)
                {
                    if (prefs.RootFolder.Length > 0)
                    {
                        xbmc = prefs.RootFolder;
                    }
                    else
                    {
                        ; // try the current directory
                    }
                }
                else
                {
                    xbmc = env;
                }
            }
            else
            {
                xbmc = args[0];
            }

            System.IO.DirectoryInfo root = new System.IO.DirectoryInfo(xbmc);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new frmMain(root, prefs));
        }