public void CancelVideo(string ip, VideoRecievedEventHandler callback) { if (_AllDevices.Keys.Contains(ip)) { AxHVActiveX2Lib.AxHVActiveX2 axHV = _AllDevices[ip]; List <VideoRecievedEventHandler> handlers = axHV.Tag as List <VideoRecievedEventHandler>; if (handlers != null) { handlers.Remove(callback); if (handlers.Count == 0) { axHV.Tag = DateTime.Now; } } } }
public void RequestVideo(string ip, VideoRecievedEventHandler callback) { if (_AllDevices.Keys.Contains(ip)) { AxHVActiveX2Lib.AxHVActiveX2 axHV = _AllDevices[ip]; if (axHV.GetStatus() != 0) { axHV.ConnectTo(ip); axHV.RecvVideoFlag = 1; } List <VideoRecievedEventHandler> handlers = axHV.Tag as List <VideoRecievedEventHandler>; if (handlers == null) { handlers = new List <VideoRecievedEventHandler>(); } if (!handlers.Any(c => c == callback)) { handlers.Add(callback); } axHV.Tag = handlers; } }