Exemplo n.º 1
0
        public FileStream GetHandle()
        {
            timeoutTimer?.Stop();
            ActionFileStream stream = new ActionFileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, new Action <ActionFileStream>((str) => { OnHandleClosed(str); }));

            handles.Add(stream);
            return(stream);
        }
Exemplo n.º 2
0
 public void OnHandleClosed(ActionFileStream stream)
 {
     if (handles.Contains(stream))
     {
         handles.Remove(stream);
         if (handles.Count == 0)
         {
             SetTimeout();
         }
     }
 }