Inheritance: Framework.Interfaces.ICore
Exemple #1
0
        private async void timerStart_Tick(object sender, EventArgs e)
        {
            timerStart.Enabled = false;

            _engine = new Core.Engine();
            _engine.LoadingAssembly +=new Core.Engine.LoadingAssemblyHandler(_engine_LoadingAssembly);
            _engine.InitializingPlugin += new Core.Engine.LoadingAssemblyHandler(_engine_InitializingPlugin);
            _engine.PluginAdded += new Framework.EventArguments.PluginEventHandler(_engine_PluginAdded);
            if (await _engine.Initialize())
            {
                List<Framework.Interfaces.IPlugin> p = _engine.GetPlugin(Framework.PluginType.UIMainWindow);
                if (p == null || p.Count == 0)
                {
                    Close();
                }
                else
                {
                    Hide();
                    await _engine.ApplicationInitialized();
                    string[] args = Environment.GetCommandLineArgs();
                    ProcessCommandLine((from s in args select s).Skip(1).ToArray());
                }
            }
            else
            {
                _engine.RestoreDefaultSettings();
                Close();
            }
        }
Exemple #2
0
        public SelectSettingsForm(Engine eng)
        {
            InitializeComponent();

            checkBox1.Checked = Properties.Settings.Default.EnablePluginDataPathAtStartup;

            try
            {
                //no check if valid

                listBox1.Items.Add(eng.PluginDataPath);
                string[] lst = eng.AvailablePluginDataPaths;
                if (lst != null && lst.Length > 0)
                {
                    listBox1.Items.AddRange((from a in lst where string.Compare(a, eng.PluginDataPath, true) != 0 select a).Distinct().ToArray());
                }
            }
            catch
            {
                //oeps
                //fall back to factory default
                string p = System.IO.Path.Combine(new string[] { System.Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "GlobalcachingApplication" });
                Properties.Settings.Default.PluginDataPath = p.TrimEnd(new char[] { '\\', '/' });
                listBox1.Items.Add(eng.PluginDataPath);
            }
            listBox1.SelectedItem = eng.PluginDataPath;
        }
Exemple #3
0
        private async void timerStart_Tick(object sender, EventArgs e)
        {
            timerStart.Enabled = false;

            _engine = new Core.Engine();
            _engine.LoadingAssembly    += new Core.Engine.LoadingAssemblyHandler(_engine_LoadingAssembly);
            _engine.InitializingPlugin += new Core.Engine.LoadingAssemblyHandler(_engine_InitializingPlugin);
            _engine.PluginAdded        += new Framework.EventArguments.PluginEventHandler(_engine_PluginAdded);
            if (await _engine.Initialize())
            {
                List <Framework.Interfaces.IPlugin> p = _engine.GetPlugin(Framework.PluginType.UIMainWindow);
                if (p == null || p.Count == 0)
                {
                    Close();
                }
                else
                {
                    Hide();
                    await _engine.ApplicationInitialized();

                    string[] args = Environment.GetCommandLineArgs();
                    ProcessCommandLine((from s in args select s).Skip(1).ToArray());
                }
            }
            else
            {
                _engine.RestoreDefaultSettings();
                Close();
            }
        }