Exemplo n.º 1
0
        public Main(string[] parameter)
        {
            initPhase = true;

            InitializeComponent();
            CreateHandle();

            // check Language-buttons
            switch (Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName)
            {
            case "de":
                germanMenuItem.Checked = true;
                break;

            default:
                englishMenuItem.Checked = true;
                break;
            }

            // Load welcomepage
            try {
                infoWebBrowser.Navigate("file://" + Application.StartupPath + Resource.MainWelcomePagePath);
            }
            catch {}

            manager = new PluginManager();

            try {
                manager.LoadSettings();
            }
            catch (Exception ex) {
                ExceptionViewer problems = new ExceptionViewer(ex);
                problems.ShowDialog(this);
            }

            // Set Window-Position
            WindowState = Settings.Default.windowState;
            Location    = Settings.Default.windowPosition;
            Size        = Settings.Default.windowSize;

            manager.SearchForPlugins();
            timer.Enabled = true;

            // Forward startparameter
            foreach (PluginItem plugin in manager.ProducerPlugins)
            {
                plugin.Producer.StartupParameter(parameter);
            }
            foreach (PluginItem plugin in manager.ConsumerPlugins)
            {
                plugin.Consumer.StartupParameter(parameter);
            }

            foreach (string p in parameter)
            {
                if (p.ToUpper() == "/START")
                {
                    directstart = true;
                }
            }

            initPhase = false;
        }
Exemplo n.º 2
0
        public Main(string[] parameter)
        {
            initPhase = true;

            InitializeComponent();
            onlineButton.Tag = ConnectionState.Connected;
            CreateHandle();

            // check Language-buttons
            switch (Thread.CurrentThread.CurrentUICulture.TwoLetterISOLanguageName)
            {
            case "de":
                germanMenuItem.Checked = true;
                break;

            default:
                englishMenuItem.Checked = true;
                break;
            }

            // Load Player
            Task t = new Task(() => { PlayerStore.Instance.ToString(); });

            t.Start();

            // Prüfe auf Updates
            t = new Task(BackgroundUpdateCheck);
            t.Start();

            // Load welcomepage
            try
            {
                infoWebBrowser.Navigate(Resource.MainWelcomePageUrl);
            }
            catch { }

            manager = new PluginManager();

            try
            {
                manager.LoadSettings();
            }
            catch (Exception ex)
            {
                ExceptionViewer problems = new ExceptionViewer(ex);
                problems.ShowDialog(this);
            }

            // Set Window-Position
            WindowState = Settings.Default.windowState;
            Location    = Settings.Default.windowPosition;
            Size        = Settings.Default.windowSize;

            manager.SearchForPlugins();
            timer.Enabled = true;

            // Forward startparameter
            foreach (PluginItem plugin in manager.ProducerPlugins)
            {
                plugin.Producer.StartupParameter(parameter);
            }
            foreach (PluginItem plugin in manager.ConsumerPlugins)
            {
                plugin.Consumer.StartupParameter(parameter);
            }

            foreach (string p in parameter)
            {
                if (p.ToUpper() == "/START")
                {
                    directstart = true;
                }
            }

            initPhase = false;
        }