Exemplo n.º 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();
        }
Exemplo n.º 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);
            }
        }
Exemplo n.º 6
0
        private void EventSinkEx(UPnPRelayDevice d, long EventCounter)
        {
            ListViewItem lvi = (ListViewItem)InboundListViewTable[d];

            lvi.SubItems[2].Text = EventCounter.ToString();
        }
Exemplo n.º 7
0
 private void RelayRemovedSink(Gatekeeper sender, UPnPRelayDevice d)
 {
     RemoveInboundDevice(d);
 }
Exemplo n.º 8
0
        private void ActionSinkEx(UPnPRelayDevice d, long ActionCounter)
        {
            ListViewItem lvi = (ListViewItem)InboundListViewTable[d];

            lvi.SubItems[1].Text = ActionCounter.ToString();
        }
Exemplo n.º 9
0
 private void EventSink(UPnPRelayDevice d, long EventCounter)
 {
     this.BeginInvoke(new UPnPRelayDevice.EventCounterHandler(EventSinkEx), new object[2] {
         d, EventCounter
     });
 }
Exemplo n.º 10
0
 private void ActionSinkEx(UPnPRelayDevice d, long ActionCounter)
 {
     ListViewItem lvi = (ListViewItem)InboundListViewTable[d];
     lvi.SubItems[1].Text = ActionCounter.ToString();
 }
Exemplo n.º 11
0
 private void ActionSink(UPnPRelayDevice d, long ActionCounter)
 {
     this.BeginInvoke(new UPnPRelayDevice.ActionCounterHandler(ActionSinkEx), new object[2] {
         d, ActionCounter
     });
 }
Exemplo n.º 12
0
 private void ActionSink(UPnPRelayDevice d, long ActionCounter)
 {
     this.BeginInvoke(new UPnPRelayDevice.ActionCounterHandler(ActionSinkEx),new object[2]{d,ActionCounter});
 }
Exemplo n.º 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();
 }
Exemplo n.º 14
0
 private void EventSink(UPnPRelayDevice d, long EventCounter)
 {
     this.BeginInvoke(new UPnPRelayDevice.EventCounterHandler(EventSinkEx),new object[2]{d,EventCounter});
 }
Exemplo n.º 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();
        }
Exemplo n.º 16
0
 private void RelaySink(Gatekeeper sender, UPnPRelayDevice d)
 {
     AddNewInboundDevice(d);
 }
Exemplo n.º 17
0
 private void RelayRemovedSink(Gatekeeper sender, UPnPRelayDevice d)
 {
     RemoveInboundDevice(d);
 }
Exemplo n.º 18
0
 private void EventSinkEx(UPnPRelayDevice d, long EventCounter)
 {
     ListViewItem lvi = (ListViewItem)InboundListViewTable[d];
     lvi.SubItems[2].Text = EventCounter.ToString();
 }
Exemplo n.º 19
0
 private void RelaySink(Gatekeeper sender, UPnPRelayDevice d)
 {
     AddNewInboundDevice(d);
 }
Exemplo n.º 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);
        }