示例#1
0
        internal void Initialize()
        {
            UISettings.InitSettings();

            try
            {
                DialogControl.InitializeDialogs(this);
                StatusDialogControl.InitializeDialogs(this);
                LoadingControl.InitializeDialogs(this);
                UpdateInfoDialogControl.InitializeDialogs(this);

                DebugHelper.WriteLogEntry("ScreenDPI = " + UISettings.ScreenDPI);

                try
                {
                    if (UISettings.ScreenDPI <= 128)
                    {
                        _skinManager = new SkinManager(SystemConfiguration.AppInstallPath + "\\Skins", 96);
                        _skinManager.LoadSkin("VKSkin96");
                    }
                    else
                    {
                        _skinManager = new SkinManager(SystemConfiguration.AppInstallPath + "\\Skins", 192);
                        _skinManager.LoadSkin("VKSkin192");
                    }
                }
                catch
                {
                    MessageBox.Show(Resources.MasterForm_Initialize_SkinManagerLoadingException);
                    DebugHelper.WriteLogEntry(Resources.MasterForm_Initialize_SkinManagerLoadingException);
                }

                if (!_skinManager.Initialized)
                {
                    _skinManager.LoadSkin("Default");
                }
            }
            catch (Exception)
            {
                MessageBox.Show(Resources.MasterForm_Initialize_SkinManagerDefaultLoadingException);
                DebugHelper.WriteLogEntry(Resources.MasterForm_Initialize_SkinManagerDefaultLoadingException);
                Application.Exit();
            }
        }