示例#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);
        }