Exemplo n.º 1
0
        public SplashProvider(string[] args)
        {
            if (m_Instance != null)
                throw new InvalidOperationException();
            m_Instance = this;

            m_Arguments = args;

            m_IsLoadingDialog = new IsLoadingDialog();
            m_IsLoadingDialog.FormClosed += new FormClosedEventHandler(IsLoadingDialog_FormClosed);
            m_IsLoadingDialog.Show();
            m_IsLoadingDialog.Activate();

            Thread coreThread = new Thread(delegate()
            {
                try
                {
                    if (bool.Parse(Settings.Instance["FirstStart"]))
                        Settings.Instance.Upgrade();

                    Core.Load();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString(), String.Format(Constants.Software, Core.Version), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                }
                m_IsLoaded = true;
            });
            coreThread.Name = "coreThread";
            coreThread.IsBackground = true;
            coreThread.Start();
        }
Exemplo n.º 2
0
        public SplashProvider(string[] args)
        {
            if (m_Instance != null)
            {
                throw new InvalidOperationException();
            }
            m_Instance = this;

            m_Arguments = args;

            m_IsLoadingDialog             = new IsLoadingDialog();
            m_IsLoadingDialog.FormClosed += new FormClosedEventHandler(IsLoadingDialog_FormClosed);
            m_IsLoadingDialog.Show();
            m_IsLoadingDialog.Activate();

            Thread coreThread = new Thread(delegate()
            {
                try
                {
                    if (bool.Parse(Settings.Instance["FirstStart"]))
                    {
                        Settings.Instance.Upgrade();
                    }

                    Core.Load();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString(), String.Format(Constants.Software, Core.Version), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1);
                }
                m_IsLoaded = true;
            });

            coreThread.Name         = "coreThread";
            coreThread.IsBackground = true;
            coreThread.Start();
        }