Ejemplo n.º 1
0
        public PersistentSubscription[] GetAllSubscribers()
        {
            PublishSubscribeDataSet.PersistentSubscribersDataTable subscribers = new PublishSubscribeDataSet.PersistentSubscribersDataTable();
            PersistentSubscribersTableAdapter adapter = new PersistentSubscribersTableAdapter();

            subscribers = adapter.GetAllSubscribers();
            return(Convert(subscribers));
        }
Ejemplo n.º 2
0
        public PersistentSubscription[] GetSubscribersToContract(string eventContract)
        {
            PublishSubscribeDataSet.PersistentSubscribersDataTable subscribers = new PublishSubscribeDataSet.PersistentSubscribersDataTable();
            PersistentSubscribersTableAdapter adapter = new PersistentSubscribersTableAdapter();

            subscribers = adapter.GetSubscribersToContract(eventContract);
            return(Convert(subscribers));
        }
Ejemplo n.º 3
0
        static void RemovePersistent(string address, string eventsContract, string eventOperation)
        {
            PersistentSubscribersTableAdapter adapter = new PersistentSubscribersTableAdapter();

            PublishSubscribeDataSet.PersistentSubscribersDataTable subscribers = adapter.GetSubscribersByAddressContractOperation(address, eventsContract, eventOperation);
            foreach (PublishSubscribeDataSet.PersistentSubscribersRow subscriber in subscribers)
            {
                adapter.Delete(subscriber.Address, subscriber.Operation, subscriber.Contract, subscriber.ID);
            }
        }
Ejemplo n.º 4
0
        public PersistentSubscription[] GetAllSubscribersFromAddress(string address)
        {
            VerifyAddress(address);

            PublishSubscribeDataSet.PersistentSubscribersDataTable subscribers = new PublishSubscribeDataSet.PersistentSubscribersDataTable();

            PersistentSubscribersTableAdapter adapter = new PersistentSubscribersTableAdapter();

            subscribers = adapter.GetSubscribersFromAddress(address);

            return(Convert(subscribers));
        }
Ejemplo n.º 5
0
        static void AddPersistent(string address, string eventsContract, string eventOperation)
        {
            bool exists = ContainsPersistent(address, eventsContract, eventOperation);

            if (exists)
            {
                return;
            }
            PersistentSubscribersTableAdapter adapter = new PersistentSubscribersTableAdapter();

            adapter.Insert(address, eventOperation, eventsContract);
        }
Ejemplo n.º 6
0
        static string[] GetSubscribersToContractEventOperation(string eventsContract, string eventOperation)
        {
            PublishSubscribeDataSet.PersistentSubscribersDataTable subscribers = new PublishSubscribeDataSet.PersistentSubscribersDataTable();
            PersistentSubscribersTableAdapter adapter = new PersistentSubscribersTableAdapter();

            subscribers = adapter.GetSubscribersToContractOperation(eventsContract, eventOperation);

            Func <PublishSubscribeDataSet.PersistentSubscribersRow, string> extract = (row) =>
            {
                return(row.Address);
            };

            return(subscribers.ToArray(extract));
        }
Ejemplo n.º 7
0
        static string[] GetSubscribersToContractEventOperation(string eventsContract, string eventOperation)
        {
            PublishSubscribeDataSet.PersistentSubscribersDataTable subscribers = new PublishSubscribeDataSet.PersistentSubscribersDataTable();
            PersistentSubscribersTableAdapter adapter = new PersistentSubscribersTableAdapter();

            subscribers = adapter.GetSubscribersToContractOperation(eventsContract, eventOperation);

            Converter <PublishSubscribeDataSet.PersistentSubscribersRow, string> extract = delegate(PublishSubscribeDataSet.PersistentSubscribersRow row)
            {
                return(row.Address);
            };

            return(DataTableHelper.ToArray(subscribers, extract));
        }
Ejemplo n.º 8
0
        static string[] GetSubscribersToContractEventOperation(string eventsContract, string eventOperation)
        {
            PublishSubscribeDataSet.PersistentSubscribersDataTable subscribers = new PublishSubscribeDataSet.PersistentSubscribersDataTable();
            PersistentSubscribersTableAdapter adapter = new PersistentSubscribersTableAdapter();

            subscribers = adapter.GetSubscribersToContractOperation(eventsContract, eventOperation);

            List <string> list = new List <string>();

            foreach (PublishSubscribeDataSet.PersistentSubscribersRow row in subscribers)
            {
                list.Add(row.Address);
            }
            return(list.ToArray());
        }