private void RaiseCollapseEvent(ThreadedListViewItem tlv)
 {
     if (CollapseThread != null)
     {
         var tea = new ThreadEventArgs(tlv);
         //TODO: add the thread child elements to eventArgs
         try
         {
             CollapseThread(this, tea);
         }
         catch (Exception ex)
         {
             _log.Error("Event CollapseThread() failed", ex);
         }
     }
 }
 private void RaiseAfterExpandEvent(ThreadedListViewItem parent, ThreadedListViewItem[] newItems)
 {
     if (AfterExpandThread != null)
     {
         var tea = new ThreadEventArgs(parent)
         {
             ChildItems = newItems
         };
         try
         {
             AfterExpandThread(this, tea);
         }
         catch (Exception ex)
         {
             _log.Error("Event AfterExpandThread() failed", ex);
         }
     }
 }
 private ThreadedListViewItem[] RaiseExpandEvent(ThreadedListViewItem tlv)
 {
     if (ExpandThread != null)
     {
         var tea = new ThreadEventArgs(tlv);
         try
         {
             ExpandThread(this, tea);
         }
         catch (Exception ex)
         {
             _log.Error("Event ExpandThread() failed", ex);
         }
         if (tea.ChildItems != null)
         {
             return(tea.ChildItems);
         }
     }
     return(new ThreadedListViewItem[] {});
 }