コード例 #1
0
 /// <summary>
 /// Calls the specified delegate recursively for each outline element
 /// </summary>
 /// <param name="collection">Collection with outline items</param>
 /// <param name="callback">Delegate to call for each item</param>
 private void RecursiveWorker(OpmlOutlineCollection collection, OutlineCallbackDelegate callback)
 {
     //
     for (int i = 0; i < collection.Count; i++)
     //foreach(OpmlOutlineFavorite o in collection)
     {
         OpmlOutlineFavorite o = (OpmlOutlineFavorite)collection[i];
         //
         if (o.Items.Count > 0)
         {
             RecursiveWorker(o.Items, callback);
         }
         else
         {
             try
             {
                 callback(o);
             }
             catch (System.Exception e)
             {
                 _exceptionTable.Add(o, e);
             }
         }
     }
 }
コード例 #2
0
 internal RecursiveWorkerThread(OpmlOutlineCollection collection, OutlineCallbackDelegate callback)
 {
     _collection = collection;
     _callback   = callback;
     // let's go
     //System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(Start));
     System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(Run));
     thread.IsBackground = true;
     thread.Start();
 }
コード例 #3
0
 /// <summary>
 /// Calls the specified delegate recursively for each outline element
 /// </summary>
 /// <param name="collection">Collection with outline items</param>
 /// <param name="callback">Delegate to call for each item</param>
 private void RecursiveWorker(OpmlOutlineCollection collection, OutlineCallbackDelegate callback)
 {
     for (int i = 0; i < collection.Count; i++)
     //foreach(OpmlOutlineFavorite o in collection)
     {
         OpmlOutlineFavorite o = (OpmlOutlineFavorite)collection[i];
         //
         if (o.Items.Count > 0)
         {
             RecursiveWorker(o.Items, callback);
         }
         else
         {
             try
             {
                 callback(o);
             }
             catch (Exception e)
             {
                 _exceptionTable.Add(o, e);
             }
         }
     }
 }
コード例 #4
0
 internal RecursiveWorkerThread(OpmlOutlineCollection collection, OutlineCallbackDelegate callback)
 {
     _collection = collection;
     _callback = callback;
     // let's go
     //System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(Start));
     System.Threading.Thread thread = new System.Threading.Thread(new System.Threading.ThreadStart(Run));
     thread.IsBackground = true;
     thread.Start();
 }