예제 #1
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;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="TribePadWorkPatternParser"/> class.
 /// </summary>
 /// <param name="lookupValuesProvider">A method of supplying lookup values for identifiers referenced by the job data</param>
 /// <param name="workPatternSplitter">A method of splitting apart multiple work patterns encoded into one work pattern</param>
 /// <exception cref="ArgumentNullException">lookupValuesProvider or workPatternSplitter</exception>
 public TribePadWorkPatternParser(IJobsLookupValuesProvider lookupValuesProvider, IWorkPatternSplitter workPatternSplitter)
 {
     _lookupValuesProvider = lookupValuesProvider ?? throw new ArgumentNullException(nameof(lookupValuesProvider));
     _workPatternSplitter  = workPatternSplitter ?? throw new ArgumentNullException(nameof(workPatternSplitter));
 }