private async void createSessionToolStripMenuItem_Click(object sender, EventArgs evt) {
     try {
         using (GUISession session = new GUISession()) {
             session.ShowDialog(this);
             if (session.confirmed == true) {
                 // Wait for running tasks.
                 await Task.WhenAll(m_tasks);
                 // Create the new task and add it to the queue.
                 Task task;
                 m_tasks.Add(task = CreateSession(session));
                 // Run the event.
                 await Task.Run(() => task);
                 // Remove it from the queue.
                 m_tasks.Remove(task);
             }
         }
     } catch (Exception e) {
         Program.HandleException(this, e);
     }
 }