using System.Collections.Generic; namespace EC.Onvif.Camera { public class CameraManager { private Dictionary CameraList = new Dictionary(); public bool Add(Camera camera) { if (CameraList.ContainsKey(camera.CameraCode)) { return false; } else { CameraList.Add(camera.CameraCode, camera); return true; } } public Camera GetCameraByCode(string cameraCode) { if (CameraList.ContainsKey(cameraCode)) { return CameraList[cameraCode]; } return null; } public void Remove(Camera camera) { CameraList.Remove(camera.CameraCode); } public void Remove(string cameraCode) { CameraList.Remove(cameraCode); } } }