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(); }
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); } }
private void EventSinkEx(UPnPRelayDevice d, long EventCounter) { ListViewItem lvi = (ListViewItem)InboundListViewTable[d]; lvi.SubItems[2].Text = EventCounter.ToString(); }
private void RelayRemovedSink(Gatekeeper sender, UPnPRelayDevice d) { RemoveInboundDevice(d); }
private void ActionSinkEx(UPnPRelayDevice d, long ActionCounter) { ListViewItem lvi = (ListViewItem)InboundListViewTable[d]; lvi.SubItems[1].Text = ActionCounter.ToString(); }
private void EventSink(UPnPRelayDevice d, long EventCounter) { this.BeginInvoke(new UPnPRelayDevice.EventCounterHandler(EventSinkEx), new object[2] { d, EventCounter }); }
private void ActionSink(UPnPRelayDevice d, long ActionCounter) { this.BeginInvoke(new UPnPRelayDevice.ActionCounterHandler(ActionSinkEx), new object[2] { d, ActionCounter }); }
private void ActionSink(UPnPRelayDevice d, long ActionCounter) { this.BeginInvoke(new UPnPRelayDevice.ActionCounterHandler(ActionSinkEx),new object[2]{d,ActionCounter}); }
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 EventSink(UPnPRelayDevice d, long EventCounter) { this.BeginInvoke(new UPnPRelayDevice.EventCounterHandler(EventSinkEx),new object[2]{d,EventCounter}); }
private void RelaySink(Gatekeeper sender, UPnPRelayDevice d) { AddNewInboundDevice(d); }
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); }