Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
 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);
     }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 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)
 {
 }
 /// <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)
 {
 }
 /// <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)
 {
 }
        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;
        }