public VideoPipe GetVideoPipe(string cameraNO)
{
if (listVideoPipeOperateLock.TryEnterWriteLock(CgwConst.ENTER_PIPE_LOCK_WAIT_TIME))
{
try
{
int index = listVideoPipe.FindIndex((x) => { return x.CameraNo == cameraNO ? true : false; });
if (index != -1)
{
VideoPipe videoPipe = listVideoPipe.Find((x) => { return x.CameraNo == cameraNO ? true : false; });
return videoPipe;
}
}
finally
{
listVideoPipeOperateLock.ExitWriteLock();
}
}
return null;
}