Пример #1
0
        /// <summary>
        /// Add the miss information to the APIConnectionInformation.
        /// </summary>
        /// <param name="apiInfo">Object contain the Api info form the env and file.</param>
        /// <returns>Object contain the Api info.</returns>
        public APIConnectionInformation RetrieveConfigurationInformation(APIConnectionInformation apiInfo)
        {
            GetEnvConnectionInformation.RetrieveEnvironmentInformation(apiInfo);
            if (apiInfo.IsComplete())
            {
                return(apiInfo);
            }

            try
            {
                string configFilePath             = this.GetConfigFilePath();
                APIConnectionInformation fileInfo = this.FileInformationGetter.ReadFile(configFilePath);
                apiInfo.Update(fileInfo);
            }
            catch (FileNotFoundException)
            {
                if (string.IsNullOrEmpty(apiInfo.Token))
                {
                    throw;
                }
            }

            return(apiInfo);
        }