private void refreshFileTabs()
 {
     if (allowFileRefresh)
     {
         clearFileTabs();
         int left = 0;
         int top  = fileListButton.Top;
         foreach (String file in editorController.OpenFiles)
         {
             EditorTaskbarFileButton fileButton = new EditorTaskbarFileButton(widget, file, left, top);
             fileButton.CurrentFile = currentFile == file;
             fileButton.ChangeFile += new Action <EditorTaskbarFileButton>(fileButton_ChangeFile);
             fileButton.Closed     += new Action <EditorTaskbarFileButton>(fileButton_Closed);
             left += fileButton.Width;
             if (left > fileListButton.Left)
             {
                 fileButton.Dispose();
                 break;
             }
             else
             {
                 fileButtons.Add(fileButton);
             }
         }
     }
 }
 void fileButton_Closed(EditorTaskbarFileButton obj)
 {
     editorController.closeFile(obj.File);
     if (obj.CurrentFile)
     {
         if (editorController.OpenFileCount == 0)
         {
             ViewHost.Context.runAction(closeAction, ViewHost);
         }
         else
         {
             editorController.openEditor(editorController.OpenFiles.First());
         }
     }
     else
     {
         refreshFileTabs();
     }
 }
 void fileButton_ChangeFile(EditorTaskbarFileButton obj)
 {
     editorController.openEditor(obj.File);
 }