コード例 #1
0
        /// <summary>
        /// Créé une nouvelle instance de MonitoredBroker.
        /// </summary>
        /// <param name="broker">Broker à décorer.</param>
        public MonitoredBroker(ISearchBroker <TDocument> broker)
        {
            if (broker == null)
            {
                throw new ArgumentNullException(nameof(broker));
            }

            _broker = broker;
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: harvey007y/IdealAutomate
 private Searcher CreateSearcher(ISearchBroker broker)
 {
     try
     {
         return(broker.CreateSearcher(client, maximumCount));
     }
     catch (Exception ex)
     {
         MessageBox.Show(this, ex.Message, "Invalid Search", MessageBoxButtons.OK,
                         MessageBoxIcon.Warning);
         return(null);
     }
 }
コード例 #3
0
 /// <summary>
 /// Default constructor with dependency injected broker
 /// </summary>
 /// <param name="broker">The implementation of the broker to use</param>
 public QuerySearch(ISearchBroker broker)
 {
     this.broker = broker;
 }
コード例 #4
0
 /// <summary>
 /// Constructor to inject the broker and other items via DI then channel to base class
 /// </summary>
 /// <param name="broker"></param>
 public EUCompanySearch(ISearchBroker broker) : base(broker, SearchType.EU)
 {
 }
コード例 #5
0
 /// <summary>
 /// Default constructor with dependency injected broker
 /// </summary>
 /// <param name="broker">The implementation of the broker to use</param>
 public StartSearch(ISearchBroker broker)
 {
     this.broker = broker;
 }
 /// <summary>
 /// Constructor to inject the broker and other items via DI then channel to base class
 /// </summary>
 /// <param name="broker"></param>
 public InternationalCompanySearch(ISearchBroker broker) : base(broker, SearchType.International)
 {
 }
コード例 #7
0
 /// <summary>
 /// Constructor to inject the broker and other items via DI then channel to base class
 /// </summary>
 /// <param name="broker"></param>
 public UKCompanySearch(ISearchBroker broker) : base(broker, SearchType.UK)
 {
 }
コード例 #8
0
        private const Double ChanceOfFailure  = 0.10; // Double because Random is double

        /// <summary>
        /// Base constructor which the searches will channel their dependency injected items to
        /// </summary>
        /// <param name="broker">The prefered search broker to use</param>
        public CompanySearchBase(ISearchBroker broker, SearchType searchType)
        {
            this.broker     = broker;
            this.searchType = searchType;
        }