public ApiKeyInfo GetApiKeyInfo(IApplicationNameProvider nameProvider) { if (_apiKeyInfo == null) { if (File.Exists(ApiKeyFilePath)) { _apiKeyInfo = ApiKeyFilePath.FromJsonFile <ApiKeyInfo>(); } else { FireEvent(ApiKeyFileNotFound); _apiKeyInfo = ApplicationRegistryService.GetClientApiKeyInfo(); _apiKeyInfo.ApplicationName = nameProvider.GetApplicationName(); EnsureApiKeyFileDirectory(); _apiKeyInfo.ToJsonFile(ApiKeyFilePath); } } return(_apiKeyInfo); }
public ApiKeyInfo RegisterApplication() { RegisterApplicationProcess(); return(ApiKeyFilePath.FromJsonFile <ApiKeyInfo>()); }