public override Receiver CreateReceiver(ReceiverConfiguration Configuration)
        {
            int MaxNumberOfReceivers = GetServiceCapabilities().SupportedReceivers;

            Receiver receiver = null;

            if (Search.SearchStorage.Instance.Receivers.Count < MaxNumberOfReceivers)
            {
                receiver = new Receiver()
                {
                    Token         = string.Format("receiver{0}", Search.SearchStorage.Instance.Receivers.Count + 1),
                    Configuration = Configuration
                };
                Search.SearchStorage.Instance.Receivers.Add(receiver);
            }
            else
            {
                ReturnFault(new string[] { "Receiver", "Action", "MaxReceivers" });
            }
            return(receiver);
        }
        public override void ConfigureReceiver(string ReceiverToken, ReceiverConfiguration Configuration)
        {
            Receiver receiver = Search.SearchStorage.Instance.Receivers.Where(r => r.Token == ReceiverToken).FirstOrDefault();

            if (receiver != default(Receiver))
            {
                receiver.Configuration = Configuration;

                switch (Configuration.Mode)
                {
                case ReceiverMode.AlwaysConnect:
                    NotifyReceiverStateChange(ReceiverToken, "Connected");
                    break;

                case ReceiverMode.NeverConnect:
                    NotifyReceiverStateChange(ReceiverToken, "NotConnected");
                    break;
                }
            }
            else
            {
                ReturnFault(new string[] { "Sender", "InvalidArgVal", "UnknownToken" });
            }
        }
Exemplo n.º 3
0
 public abstract void ConfigureReceiver(string ReceiverToken, ReceiverConfiguration Configuration);
Exemplo n.º 4
0
 public abstract Receiver CreateReceiver(ReceiverConfiguration Configuration);