示例#1
0
 internal static void SubmitOperations(List<object> operations, ThrottleManager throttleManager)
 {
     List<IThrottleOperation> list = new List<IThrottleOperation>();
     foreach (object obj2 in operations)
     {
         list.Add((IThrottleOperation) obj2);
     }
     throttleManager.SubmitOperations(list);
 }
示例#2
0
        internal static void SubmitOperations(List <object> operations, ThrottleManager throttleManager)
        {
            List <IThrottleOperation> list = new List <IThrottleOperation>();

            foreach (object obj2 in operations)
            {
                list.Add((IThrottleOperation)obj2);
            }
            throttleManager.SubmitOperations(list);
        }
        internal static void SubmitOperations(List <object> operations, ThrottleManager throttleManager)
        {
            List <IThrottleOperation> newOperations = new List <IThrottleOperation>();

            foreach (object operation in operations)
            {
                newOperations.Add((IThrottleOperation)operation);
            }

            throttleManager.SubmitOperations(newOperations);
        }
示例#4
0
        internal static void SubmitOperations(List<object> operations, ThrottleManager throttleManager)
        {
            List<IThrottleOperation> newOperations = new List<IThrottleOperation>();
            foreach (object operation in operations)
            {
                newOperations.Add((IThrottleOperation)operation);
            }

            throttleManager.SubmitOperations(newOperations);
        }
示例#5
0
 private void SubmitAndWaitForConnect(List<IThrottleOperation> connectJobOperations)
 {
     using (ThrottleManager manager = new ThrottleManager())
     {
         EventHandler<EventArgs> handler2 = null;
         using (ManualResetEvent connectResult = new ManualResetEvent(false))
         {
             if (handler2 == null)
             {
                 handler2 = (sender, eventArgs) => connectResult.Set();
             }
             EventHandler<EventArgs> handler = handler2;
             manager.ThrottleComplete += handler;
             try
             {
                 manager.ThrottleLimit = 0;
                 manager.SubmitOperations(connectJobOperations);
                 manager.EndSubmitOperations();
                 connectResult.WaitOne();
             }
             finally
             {
                 manager.ThrottleComplete -= handler;
             }
         }
     }
 }