private async Task <IList <JobsLookupValue> > ReadLookupValuesFromTalentLink(IJobLookupValuesParser parser, string fieldName)
        {
            var htmlStream = await ReadHtml(_searchUrl, _proxy);

            using (var reader = new StreamReader(htmlStream))
            {
                return(parser.ParseLookupValues(reader.ReadToEnd(), fieldName));
            }
        }
Esempio n. 2
0
        private async Task <IList <JobsLookupValue> > ReadLookupValuesFromApi(IJobLookupValuesParser parser, string fieldName)
        {
            var htmlStream = await ReadXml(_lookupValuesApiUrl, _proxy).ConfigureAwait(false);

            using (var reader = new StreamReader(htmlStream))
            {
                return(parser.ParseLookupValues(reader.ReadToEnd(), fieldName));
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="JobsDataFromTalentLink" /> class.
        /// </summary>
        /// <param name="searchUrl">The search URL.</param>
        /// <param name="lookupValuesParser">The parser for lookup values in the TalentLink HTML.</param>
        /// <param name="proxy">The proxy (optional).</param>
        /// <exception cref="System.ArgumentNullException">sourceUrl</exception>
        public JobsLookupValuesFromTalentLink(Uri searchUrl, IJobLookupValuesParser lookupValuesParser, IProxyProvider proxy)
        {
            if (searchUrl == null)
            {
                throw new ArgumentNullException(nameof(searchUrl));
            }
            if (lookupValuesParser == null)
            {
                throw new ArgumentNullException(nameof(lookupValuesParser));
            }

            _searchUrl          = searchUrl;
            _lookupValuesParser = lookupValuesParser;
            _proxy = proxy;
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="JobsDataFromTribePad" /> class.
        /// </summary>
        /// <param name="lookupValuesApiUrl">The search URL.</param>
        /// <param name="builtInLookupValuesParser">The parser for lookup values in built-in fields in the TribePad XML.</param>
        /// <param name="customFieldLookupValuesParser">The parser for lookup values in custom fields in the TribePad XML.</param>
        /// <param name="workPatternSplitter">A way to return work patterns that represent multiple values as multiple patterns; <c>null</c> if not required</param>
        /// <param name="proxy">The proxy (optional).</param>
        /// <exception cref="System.ArgumentNullException">lookupValuesApiUrl</exception>
        /// <exception cref="System.ArgumentNullException">builtInLookupValuesParser</exception>
        /// <exception cref="System.ArgumentNullException">customFieldLookupValuesParser</exception>
        public JobsLookupValuesFromTribePad(Uri lookupValuesApiUrl, IJobLookupValuesParser builtInLookupValuesParser, IJobLookupValuesParser customFieldLookupValuesParser, IWorkPatternSplitter workPatternSplitter, IProxyProvider proxy)
        {
            if (lookupValuesApiUrl == null)
            {
                throw new ArgumentNullException(nameof(lookupValuesApiUrl));
            }
            if (builtInLookupValuesParser == null)
            {
                throw new ArgumentNullException(nameof(builtInLookupValuesParser));
            }
            if (customFieldLookupValuesParser == null)
            {
                throw new ArgumentNullException(nameof(customFieldLookupValuesParser));
            }

            _lookupValuesApiUrl            = lookupValuesApiUrl;
            _builtInLookupValuesParser     = builtInLookupValuesParser;
            _customFieldLookupValuesParser = customFieldLookupValuesParser;
            _workPatternSplitter           = workPatternSplitter;
            _proxy = proxy;
        }