public void Add(CameraAddress addr) { IPCamera camera = null; if (!TryGet(addr, out camera)) { liveCameras.Add(new IPCamera(addr, monitor)); } }
public IPCamera(CameraAddress addr, LiveCameraMonitor monitor) { this.addr = addr; this.monitor = monitor; this.player = new VlcControl { Name = string.Format("{0}.{1}", addr.Line, addr.MachineAddr), Dock = DockStyle.Fill }; this.Prepare(); }
public bool Equals(CameraAddress other) { if (string.IsNullOrEmpty(Line) || string.IsNullOrEmpty(other.Line)) { return(false); } if (string.IsNullOrEmpty(MachineAddr) || string.IsNullOrEmpty(other.MachineAddr)) { return(false); } return(Line.Equals(other.Line) && MachineAddr.Equals(other.MachineAddr)); }
public bool TryGet(CameraAddress addr, out IPCamera camera) { camera = null; var exists = false; foreach (var cam in liveCameras) { if (cam.Address == addr) { camera = cam; exists = true; break; } } return exists; }
public bool TryGet(CameraAddress addr, out IPCamera camera) { camera = null; var exists = false; foreach (var cam in liveCameras) { if (cam.Address == addr) { camera = cam; exists = true; break; } } return(exists); }
public static CameraAddress Parse(string fileName) { CameraAddress addr = null; if (!string.IsNullOrEmpty(fileName)) { var match = new Regex(@".+\\(\d+.\d+)\\\d+.avi").Match(fileName); if (match.Success) { addr = new CameraAddress { Line = match.Groups[1].Value.Split('.')[0], MachineAddr = match.Groups[1].Value.Split('.')[0] } } ; } return(addr); } }
public IPCamera(string fileName) : this(CameraAddress.Parse(fileName), null) { this.recPath = fileName; }
public static CameraAddress Parse(string fileName) { CameraAddress addr = null; if (!string.IsNullOrEmpty(fileName)) { var match = new Regex(@".+\\(\d+.\d+)\\\d+.avi").Match(fileName); if (match.Success) addr = new CameraAddress { Line = match.Groups[1].Value.Split('.')[0], MachineAddr = match.Groups[1].Value.Split('.')[0] }; } return addr; }
public bool Equals(CameraAddress other) { if (string.IsNullOrEmpty(Line) || string.IsNullOrEmpty(other.Line)) return false; if (string.IsNullOrEmpty(MachineAddr) || string.IsNullOrEmpty(other.MachineAddr)) return false; return Line.Equals(other.Line) && MachineAddr.Equals(other.MachineAddr); }
public void Add(CameraAddress addr) { IPCamera camera = null; if (!TryGet(addr, out camera)) liveCameras.Add(new IPCamera(addr, monitor)); }