コード例 #1
0
 public void DeleteOperation(OpenFileOperation oop)
 {
     if (operationTable.Contains(oop.path))
     {
         FileOperationTableEntry entry = (FileOperationTableEntry)operationTable[oop.path];
         entry.open = null;
         if (entry.write == null)
         {
             lock (operationTable)
             {
                 operationTable.Remove(oop.path);
             }
         }
     }
 }
コード例 #2
0
        public void DeleteOperation(OpenFileOperation oop)
        {
            if (operationTable.Contains(oop.path))
            {

                FileOperationTableEntry entry = (FileOperationTableEntry)operationTable[oop.path];
                entry.open = null;
                if (entry.write == null)
                {
                    lock (operationTable)
                    {
                        operationTable.Remove(oop.path);
                    }
                }
            }
        }
コード例 #3
0
 public FileOperation.Action Update(OpenFileOperation fop)
 {
     if (open == null)
     {
         open = fop;
         Console.WriteLine("here1");
         //return open.DecideAction();
     }
     else
     {
         if (fop.date - open.date > new TimeSpan(0, 0, OpenFileOperation.suppressOpenInterval))
         {
             open.date = fop.date;
             //   return open.DecideAction();
         }
     }
     return(open.DecideAction());
 }
コード例 #4
0
        public FileOperation.Action HandleOpenOperation(string filePath)
        {
            OpenFileOperation oop = new OpenFileOperation(filePath, System.DateTime.UtcNow);

            if (!operationTable.Contains(filePath))
            {
                lock (operationTable)
                {
                    operationTable.Add(filePath, new FileOperationTableEntry(oop));
                }
                Logger.GetInstance().Debug("HandleOpenOperation added file: " + filePath);
                return(oop.DecideAction());
            }
            else
            {
                return(((FileOperationTableEntry)operationTable[filePath]).Update(oop));
            }
        }
コード例 #5
0
        public FileOperation.Action Update(OpenFileOperation fop)
        {
            if (open == null)
            {
                open = fop;
                Console.WriteLine("here1");
                //return open.DecideAction();
            }
            else
            {

                if (fop.date - open.date > new TimeSpan(0, 0, OpenFileOperation.suppressOpenInterval))
                {
                    open.date = fop.date;
                 //   return open.DecideAction();
                }
            }
            return open.DecideAction();
        }
コード例 #6
0
 public FileOperationTableEntry(OpenFileOperation fop)
 {
     this.open = fop;
 }
コード例 #7
0
 public FileOperationTableEntry(OpenFileOperation fop)
 {
     this.open = fop;
 }
コード例 #8
0
        public FileOperation.Action HandleOpenOperation(string filePath)
        {
            OpenFileOperation oop = new OpenFileOperation(filePath, System.DateTime.UtcNow);
            if (!operationTable.Contains(filePath))
            {
                lock (operationTable)
                {
                    operationTable.Add(filePath, new FileOperationTableEntry(oop));
                }
                Logger.GetInstance().Debug("HandleOpenOperation added file: " + filePath);
                return oop.DecideAction();
            }
            else
            {
                return ((FileOperationTableEntry)operationTable[filePath]).Update(oop);

            }
        }