public Stream(string name, int source, DisplayFrameDelegate DisplayFrame, WriteLogDelegate WriteLog, LogResultDelegate LogResult, UpdatePieDelegate UpdatePie, string token, StreamType type = StreamType.IN)
 {
     try
     {
         _source = source;
         _flow   = new VideoCapture(_source);
         if (!_flow.IsOpened)
         {
             throw new Exception("Couldn't find the selected streaming input for " + name);
         }
         _token        = token;
         _name         = name;
         _type         = type;
         _color        = new Bgr(51, 255, 255);
         _roi          = new Rectangle(50, 50, 300, 300);
         _lock         = new object();
         _kill         = false;
         _framesQueue  = new ConcurrentQueue <Bitmap>();
         _DisplayFrame = DisplayFrame;
         _WriteLog     = WriteLog;
         _LogResult    = LogResult;
         _UpdatePie    = UpdatePie;
         _thread       = null;
     }
     catch (Exception exception)
     {
         throw exception;
     }
 }
 public void LogResult(Registered message, string name)
 {
     if (!Dispatcher.CheckAccess())
     {
         LogResultDelegate DI = new LogResultDelegate(LogResult);
         Dispatcher.Invoke(DI, new object[] { message, name });
     }
     else
     {
         ((ListView)streams.FindName(name + "List")).Items.Add(new MyItem {
             Time = message.date, Plate = message.plate, User = message.user
         });
     }
 }