You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
720 B

using System.Collections.Generic;
namespace EC.Onvif.Camera
{
public class CameraManager
{
private Dictionary<string, Camera> CameraList = new Dictionary<string, Camera>();
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);
}
}
}