Example #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;
        }
Example #2
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;            
        }
Example #3
0
        //private void OptionsClosed(object sender, Options.ClosureEventArgs e)
        //{
        //    ShowPage(FirstMainPage);
        //    if (!String.IsNullOrEmpty(_settings.PluginPath))
        //    {
        //        _modmanager.DelPaths();
        //        _modmanager.AddPath(_settings.PluginPath);
        //    }
        //}

        protected override void Dispose(Boolean disposing)
        {
            if (_disposed)
            {
                return;
            }
            if (disposing)
            {
                if (_modules != null)
                {
                    _modules.Clear();
                    _modules = null;
                }
                if (_modmanager != null)
                {
                    _modmanager.UnloadModules();
                    _modmanager = null;
                }
            }
            _disposed = true;
            base.Dispose(disposing);
        }
Example #4
0
        //private void OptionsClosed(object sender, Options.ClosureEventArgs e)
        //{
        //    ShowPage(FirstMainPage);
        //    if (!String.IsNullOrEmpty(_settings.PluginPath))
        //    {
        //        _modmanager.DelPaths();
        //        _modmanager.AddPath(_settings.PluginPath);
        //    }
        //}

        protected override void Dispose(Boolean disposing)
        {
            if (_disposed)
                return;
            if (disposing)
            {
                if (_modules != null)
                {
                    _modules.Clear();
                    _modules = null;
                }
                if (_modmanager != null)
                {
                    _modmanager.UnloadModules();
                    _modmanager = null;
                }
            }
            _disposed = true;
            base.Dispose(disposing);
        }