void Manager_WindowRemoved(object sender, Handlers.WindowEventArgs e)
 {
     container.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
     {
         var foundItem =
             container.Children.OfType <DockIcon>().First(i => i.Windows.Any(w => w.Hwnd == e.Window.Hwnd));
         foundItem.Windows.Remove(e.Window);
         if (!foundItem.Windows.Any() && !foundItem.Info.Pinned)
         {
             container.Children.Remove(foundItem);
         }
     }));
 }
 void Manager_WindowAdded(object sender, Handlers.WindowEventArgs e)
 {
     container.Dispatcher.Invoke(DispatcherPriority.Normal, new Action(() =>
     {
         var foundItems = container.Children.OfType <DockIcon>().Select(el => el).Where(
             icon => PathTools.SamePath(icon.Info.Path, e.Window.FileName));
         DockIcon windowIcon = null;
         if (foundItems.Any())
         {
             windowIcon = foundItems.First();
         }
         if (!foundItems.Any() || (windowIcon != null && windowIcon.Windows.Count > 0))
         {
             windowIcon = new DockIcon(new IconInfo()
             {
                 Name   = Path.GetFileName(e.Window.FileName),
                 Path   = e.Window.FileName,
                 Pinned = false
             });
             container.Children.Add(windowIcon);
         }
         windowIcon.Windows.Add(e.Window);
     }));
 }