Beispiel #1
0
        public static void Initialize(GUIType gui)
        {
            AppVersion  version = new AppVersion(MajorVersion);
            IIPCAppData data    = new IPCAppData(ProjectName, ProjectShortName, version, AppStatus.NotFunctional, AppBranch.Master, TinyMessageBus.Fake);

            Domain.Create(data).Initialize <App>(gui);

            Localization = new ProgramLocalization(Settings.LanguageCode.GetValue());
        }
Beispiel #2
0
        static Globals()
        {
            Config = Config.Factory(Assembly.GetCallingAssembly().GetName().Name, false);

            CurrentDownloadFolder = Config.GetProperty(CurrentDownloadFolderKey, DefaultDownloadFolder,
                                                       path => PathUtils.IsValidPath(path, PathType.All), CryptAction.Crypt, SettingsSection);

            CurrentDownloadFileName = Config.GetProperty(CurrentDownloadFileNameKey, DefaultDownloadFileName,
                                                         path => PathUtils.IsValidPath(path, PathType.LocalFile), CryptAction.Crypt, SettingsSection);

            LanguageCode = Config.GetProperty(LanguageCodeKey, LocalizationBase.BasicCulture.LCID, SettingsSection);

            ExistFileRewrite = Config.GetProperty(ExistFileRewriteKey, false, OptionsSection);

            ConvertSVGToPNG = Config.GetProperty(ConvertSVGToPNGKey, true, OptionsSection);

            NotStrictAPICheck = Config.GetProperty(NotStrictAPICheckKey, false, OptionsSection);

            CheckHash = Config.GetProperty(CheckHashKey, false, OptionsSection);

            QueueAutoDownload = Config.GetProperty(QueueAutoDownloadKey, true, OptionsSection);

            ForceClose = Config.GetProperty(ForceCloseKey, false, OptionsSection);

            ProxyAddress = Config.GetProperty(ProxyAddressKey, @"127.0.0.1", NetworkUtils.ValidateIPv4, ProxySection);

            ProxyPort = Config.GetProperty(ProxyPortKey, 3128, NetworkUtils.ValidatePort, ProxySection);

            ProxyLogin = Config.GetProperty(ProxyLoginKey, String.Empty, null, CryptAction.Crypt, ProxySection);

            ProxyPassword = Config.GetProperty(ProxyPasswordKey, String.Empty, null, CryptAction.Crypt, ProxySection);

            APIKey = Config.GetProperty(APICodeKey, String.Empty, DerpiAPI.CheckAPI, CryptAction.Crypt, null, false, APISection);

            Localization = new ProgramLocalization(LanguageCode.GetValue());
            Logger       = new Logger();

            WebProxy = null;

            if (ProxyAddress.IsValid && ProxyAddress.Value != NetworkUtils.LocalhostIP && ProxyPort.IsValid)
            {
                WebProxy = ProxyUtils.CreateProxy(ProxyAddress.Value, ProxyPort.Value, ProxyLogin.Value, ProxyPassword.Value);
            }
        }