/// <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); } } } }
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(); }
/// <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); } } } }