Esempio n. 1
0
        public void Add(CameraAddress addr)
        {
            IPCamera camera = null;

            if (!TryGet(addr, out camera))
            {
                liveCameras.Add(new IPCamera(addr, monitor));
            }
        }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
 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));
 }
Esempio n. 4
0
 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;
 }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
    }
Esempio n. 7
0
 public IPCamera(string fileName)
     : this(CameraAddress.Parse(fileName), null)
 {
     this.recPath = fileName;
 }
Esempio n. 8
0
 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;
 }
Esempio n. 9
0
 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);
 }
Esempio n. 10
0
 public void Add(CameraAddress addr)
 {
     IPCamera camera = null;
     if (!TryGet(addr, out camera)) liveCameras.Add(new IPCamera(addr, monitor));
 }
Esempio n. 11
0
 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();
 }