示例#1
0
 public FileOperation.Action DecideAction()
 {
     if (USBController.IsUsbBlocked())
     {
         return(Action.BLOCK);
     }
     if (cached)
     {
         try
         {
             return(SeapClient.GetWriteDecisionByCache(path, cache));
         }
         catch (Exception e)
         {
             Logger.GetInstance().Error("Exception" + e);
             return(Action.ALLOW);
         }
     }
     else
     {
         try
         {
             return(SeapClient.GetWriteDecisionByPath(path, tempFilePath));
         }
         catch (Exception e)
         {
             Logger.GetInstance().Error("Exception" + e);
             return(Action.ALLOW);
         }
     }
 }
示例#2
0
        public FileOperation.Action DecideAction()
        {
            if (USBController.IsUsbBlocked())
            {
                //return Action.BLOCK;
            }

            if (action != FileOperation.Action.UNDEFINED)
            {
                //Logger.GetInstance().Debug(action + " " + path);
                return(action);
            }
            try
            {
                action = SeapClient.GetReadDecisionByPath(path);
            }
            catch (Exception e)
            {
                Logger.GetInstance().Error("Exception" + e);

                return(Action.ALLOW);
            }
            return(action);
        }