Пример #1
0
        private void Init()
        {
            DataContext = this;
            _settings = new Settings("settings.xml");

            log.Info("Current Directory = " + Directory.GetCurrentDirectory());
            log.Info("Current Directory = " + Directory.GetCurrentDirectory());
            log.Info("Modules regexp = " + _settings["ModulePattern"].Value);
            log.Info("Module paths :");
            foreach (var path in _settings["ModuleFolders"].Value as List<String>)
            {
                log.Info("Modules path = " + path);
                log.Info("Modules absolute path = " + System.IO.Path.GetFullPath(path));
            }            
            //Initialize the module manager with path to plugins

            _modmanager = new ManagerModules(((List<String>)_settings["ModuleFolders"].Value).OfType<String>());
            List<IPlugin> l = _modmanager.LoadModules(_settings["ModulePattern"].Value.ToString());
            
            log.Info("Modules found :");
            l.ForEach(p => { log.Info(p.Name); _modules.Add(p); });
            log.Info("Total modules found : " + _modules.Count);

            FirstMainPage = new ModulesList(_settings, _modules);
            FirstOptionsPage = new GAMEOptions(_settings);
            
            MainBackground.Source = new BitmapImage(new Uri("pack://application:,,,/GAME.Common.Core;component/Resources/Images/Logos/GAME_logo_white.png", UriKind.Absolute));
            MainFrame.Content = FirstMainPage;            
        }
Пример #2
0
 public ModulesList(Settings settings, ObservableCollection<IPlugin> plugins)
 {
     InitializeComponent();
     _plugins = new ObservablePluginGroup("Plugins", "");
     plugins.ToList().ForEach(_plugins.Add);
     _plugins.CollectionChanged += Update;
     PluginsToTypes();
     TypesToGroups();
     DataContext = this;
 }
Пример #3
0
 public Options(Settings settings)
 {
     InitializeComponent();
     _settings = settings;
     DataContext = _settings;
 }