Пример #1
0
        private void RemoveInboundDevice(UPnPRelayDevice d)
        {
            ListViewItem lvi = (ListViewItem)InboundListViewTable[d];

            d.OnAction -= new UPnPRelayDevice.ActionCounterHandler(ActionSink);
            d.OnEvent  -= new UPnPRelayDevice.EventCounterHandler(EventSink);

            InboundListViewTable.Remove(d);
            inboundListView.Items.Remove(lvi);
            inboundListView.Enabled = (inboundListView.Items.Count != 0);
            CheckIconState();
        }
Пример #2
0
        private void AddNewInboundDevice(UPnPRelayDevice d)
        {
            ListViewItem lvi = new ListViewItem(new String[3] {
                d.FriendlyName, "0", "0"
            }, 1);

            lvi.Tag     = d;
            d.OnAction += new UPnPRelayDevice.ActionCounterHandler(ActionSink);
            d.OnEvent  += new UPnPRelayDevice.EventCounterHandler(EventSink);
            this.InboundListViewTable[d] = lvi;
            this.inboundListView.Items.Add(lvi);
            inboundListView.Enabled = (inboundListView.Items.Count != 0);
            CheckIconState();
        }
 private void FireEventSink(System.String DeviceUDN, System.String ServiceID, System.String StateVariable, System.String Value)
 {
     lock (ProxyTable)
     {
         IDictionaryEnumerator en = ProxyTable.GetEnumerator();
         while (en.MoveNext())
         {
             UPnPRelayDevice rd = (UPnPRelayDevice)en.Value;
             if (rd.ContainsUDN(DeviceUDN))
             {
                 rd.FireEvent(DeviceUDN, ServiceID, StateVariable, Value);
                 return;
             }
         }
     }
 }
        private void NewDeviceSink(ProxyDeviceFactory sender, UPnPRelayDevice d)
        {
            ProxyFactoryTable.Remove(sender);
            lock (ProxyTable)
            {
                ProxyTable[d.UDN] = d;
                d.DV      = Root.UniqueDeviceName;
                d.Creator = this;
                d.InitStateTableThenStart();
            }

            if (this.OnUPnPRelayDevice != null)
            {
                OnUPnPRelayDevice(this, d);
            }
        }
        private void RemovedDeviceSink(System.String DeviceUDN)
        {
            UPnPRelayDevice rd = null;

            lock (ProxyTable)
            {
                if (ProxyTable.ContainsKey(DeviceUDN))
                {
                    rd = (UPnPRelayDevice)ProxyTable[DeviceUDN];
                    rd.StopDevice();
                    ProxyTable.Remove(DeviceUDN);
                }
            }
            if (rd != null && this.OnUPnPRelayDeviceRemoved != null)
            {
                OnUPnPRelayDeviceRemoved(this, rd);
            }
        }
Пример #6
0
        private void EventSinkEx(UPnPRelayDevice d, long EventCounter)
        {
            ListViewItem lvi = (ListViewItem)InboundListViewTable[d];

            lvi.SubItems[2].Text = EventCounter.ToString();
        }
Пример #7
0
 private void RelayRemovedSink(Gatekeeper sender, UPnPRelayDevice d)
 {
     RemoveInboundDevice(d);
 }
Пример #8
0
        private void ActionSinkEx(UPnPRelayDevice d, long ActionCounter)
        {
            ListViewItem lvi = (ListViewItem)InboundListViewTable[d];

            lvi.SubItems[1].Text = ActionCounter.ToString();
        }
Пример #9
0
 private void EventSink(UPnPRelayDevice d, long EventCounter)
 {
     this.BeginInvoke(new UPnPRelayDevice.EventCounterHandler(EventSinkEx), new object[2] {
         d, EventCounter
     });
 }
Пример #10
0
 private void ActionSinkEx(UPnPRelayDevice d, long ActionCounter)
 {
     ListViewItem lvi = (ListViewItem)InboundListViewTable[d];
     lvi.SubItems[1].Text = ActionCounter.ToString();
 }
Пример #11
0
 private void ActionSink(UPnPRelayDevice d, long ActionCounter)
 {
     this.BeginInvoke(new UPnPRelayDevice.ActionCounterHandler(ActionSinkEx), new object[2] {
         d, ActionCounter
     });
 }
Пример #12
0
 private void ActionSink(UPnPRelayDevice d, long ActionCounter)
 {
     this.BeginInvoke(new UPnPRelayDevice.ActionCounterHandler(ActionSinkEx),new object[2]{d,ActionCounter});
 }
Пример #13
0
 private void AddNewInboundDevice(UPnPRelayDevice d)
 {
     ListViewItem lvi = new ListViewItem(new String[3]{d.FriendlyName,"0","0"},1);
     lvi.Tag = d;
     d.OnAction += new UPnPRelayDevice.ActionCounterHandler(ActionSink);
     d.OnEvent += new UPnPRelayDevice.EventCounterHandler(EventSink);
     this.InboundListViewTable[d] = lvi;
     this.inboundListView.Items.Add(lvi);
     inboundListView.Enabled = (inboundListView.Items.Count != 0);
     CheckIconState();
 }
Пример #14
0
 private void EventSink(UPnPRelayDevice d, long EventCounter)
 {
     this.BeginInvoke(new UPnPRelayDevice.EventCounterHandler(EventSinkEx),new object[2]{d,EventCounter});
 }
Пример #15
0
        private void RemoveInboundDevice(UPnPRelayDevice d)
        {
            ListViewItem lvi = (ListViewItem)InboundListViewTable[d];
            d.OnAction -= new UPnPRelayDevice.ActionCounterHandler(ActionSink);
            d.OnEvent -= new UPnPRelayDevice.EventCounterHandler(EventSink);

            InboundListViewTable.Remove(d);
            inboundListView.Items.Remove(lvi);
            inboundListView.Enabled = (inboundListView.Items.Count != 0);
            CheckIconState();
        }
Пример #16
0
 private void RelaySink(Gatekeeper sender, UPnPRelayDevice d)
 {
     AddNewInboundDevice(d);
 }
Пример #17
0
 private void RelayRemovedSink(Gatekeeper sender, UPnPRelayDevice d)
 {
     RemoveInboundDevice(d);
 }
Пример #18
0
 private void EventSinkEx(UPnPRelayDevice d, long EventCounter)
 {
     ListViewItem lvi = (ListViewItem)InboundListViewTable[d];
     lvi.SubItems[2].Text = EventCounter.ToString();
 }
Пример #19
0
 private void RelaySink(Gatekeeper sender, UPnPRelayDevice d)
 {
     AddNewInboundDevice(d);
 }
Пример #20
0
        private void NewDeviceSink(ProxyDeviceFactory sender, UPnPRelayDevice d)
        {
            ProxyFactoryTable.Remove(sender);
            lock(ProxyTable)
            {
                ProxyTable[d.UDN] = d;
                d.DV = Root.UniqueDeviceName;
                d.Creator = this;
                d.InitStateTableThenStart();
            }

            if(this.OnUPnPRelayDevice!=null) OnUPnPRelayDevice(this,d);
        }