Ejemplo n.º 1
0
 private void remove(copyer copyer)
 {
     if (copyer.CheckName())
     {
         removeNoCheck(copyer);
     }
 }
Ejemplo n.º 2
0
 private void copyStart(copyer copyer)
 {
     if (copyer.CheckName())
     {
         bool isGuard;
         Monitor.Enter(guardLock);
         try
         {
             isGuard = guards.Remove(copyer.ProcessId);
         }
         finally { Monitor.Exit(guardLock); }
         if (isGuard)
         {
             saveCache();
         }
         log.Default.Add("启动文件复制 " + copyer.Process, new System.Diagnostics.StackFrame(), false);
         copyer.Copy();
     }
 }
Ejemplo n.º 3
0
 private void guard(copyer copyer)
 {
     if (copyer.CheckName())
     {
         copyer cache;
         Monitor.Enter(guardLock);
         try
         {
             if (guards.TryGetValue(copyer.ProcessId, out cache))
             {
                 guards[copyer.ProcessId] = copyer;
             }
             else
             {
                 guards.Add(copyer.ProcessId, copyer);
             }
         }
         finally { Monitor.Exit(guardLock); }
         if (cache != null)
         {
             pub.Dispose(ref cache);
         }
         if (!copyer.Guard(this))
         {
             Monitor.Enter(guardLock);
             try
             {
                 if (guards.TryGetValue(copyer.ProcessId, out cache) && cache == copyer)
                 {
                     guards.Remove(copyer.ProcessId);
                 }
             }
             finally { Monitor.Exit(guardLock); }
         }
         saveCache();
     }
 }
 private void remove(copyer copyer)
 {
     if (copyer.CheckName()) removeNoCheck(copyer);
 }
 private void guard(copyer copyer)
 {
     if (copyer.CheckName())
     {
         copyer cache;
         Monitor.Enter(guardLock);
         try
         {
             if (guards.TryGetValue(copyer.ProcessId, out cache)) guards[copyer.ProcessId] = copyer;
             else guards.Add(copyer.ProcessId, copyer);
         }
         finally { Monitor.Exit(guardLock); }
         if (cache != null) pub.Dispose(ref cache);
         if (!copyer.Guard(this))
         {
             Monitor.Enter(guardLock);
             try
             {
                 if (guards.TryGetValue(copyer.ProcessId, out cache) && cache == copyer) guards.Remove(copyer.ProcessId);
             }
             finally { Monitor.Exit(guardLock); }
         }
         saveCache();
     }
 }
 private void copyStart(copyer copyer)
 {
     if (copyer.CheckName())
     {
         bool isGuard;
         Monitor.Enter(guardLock);
         try
         {
             isGuard = guards.Remove(copyer.ProcessId);
         }
         finally { Monitor.Exit(guardLock); }
         if (isGuard) saveCache();
         log.Default.Add("启动文件复制 " + copyer.Process, false, false);
         copyer.Copy();
     }
 }