Exemple #1
0
        public ApiKeyState(IntentoTranslationProviderOptionsForm _form, IntentoMTFormOptions options) : base(_form, options)
        {
            apiKey = options.ApiKey;

            if (!options.ForbidSaveApikey)
            {
                string apiKey2 = _form.GetValueFromRegistry("ApiKey");
                if (string.IsNullOrEmpty(apiKey) && !string.IsNullOrEmpty(options.AppName))
                {   // read ApiKey from registry
                    apiKey = apiKey2;
                }
                if (!string.IsNullOrEmpty(apiKey2))
                {
                    form.formAdvanced.checkBoxSaveApiKeyInRegistry.Checked = true;
                }
            }
        }