Free cookie consent management tool by TermsFeed Policy Generator

Changeset 11469


Ignore:
Timestamp:
10/16/14 12:14:25 (10 years ago)
Author:
bburlacu
Message:

#2265: Reversed changes from r11467.

Location:
trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.Designer.cs

    r11467 r11469  
    5757      this.menuStrip.TabIndex = 0;
    5858      this.menuStrip.Text = "menuStrip";
    59       this.menuStrip.AllowDrop = true;
    60       this.menuStrip.DragEnter += MainFormBase_DragEnter;
    61       this.menuStrip.DragDrop += MainFormBase_DragDrop;
    6259      //
    6360      // toolStrip
     
    6764      this.toolStrip.Size = new System.Drawing.Size(624, 25);
    6865      this.toolStrip.TabIndex = 1;
    69       this.toolStrip.AllowDrop = true;
    70       this.toolStrip.DragEnter += MainFormBase_DragEnter;
    71       this.toolStrip.DragDrop += MainFormBase_DragDrop;
    7266      //
    7367      // statusStrip
     
    7973      this.statusStrip.Text = "statusStrip";
    8074      //
    81       // MainForm
     75      // MainFormBase
    8276      //
    8377      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     
    9387      this.ResumeLayout(false);
    9488      this.PerformLayout();
    95 
    9689    }
    9790
  • trunk/sources/HeuristicLab.MainForm.WindowsForms/3.3/MainForms/MainForm.cs

    r11467 r11469  
    555555      try {
    556556        ((IActionUserInterfaceItem)item.Tag).Execute();
    557       }
    558       catch (Exception ex) {
     557      } catch (Exception ex) {
    559558        ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, ex);
    560559      }
     
    601600    }
    602601    #endregion
    603 
    604     private void MainFormBase_DragEnter(object sender, DragEventArgs e) {
    605       // perform type checking to ensure that the data being dragged is of an acceptable type
    606       e.Effect = e.Data.GetDataPresent(DataFormats.FileDrop) ? DragDropEffects.Copy : DragDropEffects.None;
    607     }
    608 
    609     private void MainFormBase_DragDrop(object sender, DragEventArgs e) {
    610       if (e.Data.GetDataPresent(DataFormats.FileDrop)) {
    611         string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
    612         foreach (var path in files) {
    613           SetAppStartingCursor();
    614           ContentManager.LoadAsync(path, LoadingCompleted);
    615         }
    616       }
    617     }
    618 
    619     private static void LoadingCompleted(IStorableContent content, Exception error) {
    620       try {
    621         if (error != null) throw error;
    622         IView view = MainFormManager.MainForm.ShowContent(content);
    623         if (view == null)
    624           ErrorHandling.ShowErrorDialog("There is no view for the loaded item. It cannot be displayed.", new InvalidOperationException("No View Available"));
    625       }
    626       catch (Exception ex) {
    627         ErrorHandling.ShowErrorDialog((Control)MainFormManager.MainForm, "Cannot open file.", ex);
    628       }
    629       finally {
    630         ((MainForm)MainFormManager.MainForm).ResetAppStartingCursor();
    631       }
    632     }
    633602  }
    634603}
Note: See TracChangeset for help on using the changeset viewer.