private void Create(object sender, EventArgs args)
 {
     Window editWindow = new EditWindow(new Invoice(idir.NextFreeInvoiceNr()), null, idir, UpdateHDList);
     editWindow.Show();
 }
 private void Edit(object sender, EventArgs args)
 {
     try
     {
         string name;
         if (SelectedInvoice(out name))
         {
             Invoice invoice = new Invoice();
             string file = idir.PathName(name);
             invoice.load(file);
             Window editWindow = new EditWindow(invoice, file, idir, UpdateHDList);
             editWindow.Show();
         }
     }
     catch (System.Exception e)
     {
         MessageDialog("Error in " + e.TargetSite +
                       ": " + e.Message);
     }
 }