Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/28/11 14:53:01 (14 years ago)
Author:
swagner
Message:

Implemented review comments of mkommend (#1112)

Location:
trunk/sources/HeuristicLab.Optimization.Views/3.3
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/AlgorithmView.cs

    r5809 r5837  
    278278    protected virtual void problemTabPage_DragEnterOver(object sender, DragEventArgs e) {
    279279      e.Effect = DragDropEffects.None;
    280       if (!ReadOnly && (e.Data.GetData("HeuristicLab") != null) && Content.ProblemType.IsAssignableFrom(e.Data.GetData("HeuristicLab").GetType())) {
     280      if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) != null) && Content.ProblemType.IsAssignableFrom(e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat).GetType())) {
    281281        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
    282282        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
     
    288288    protected virtual void problemTabPage_DragDrop(object sender, DragEventArgs e) {
    289289      if (e.Effect != DragDropEffects.None) {
    290         IProblem problem = e.Data.GetData("HeuristicLab") as IProblem;
     290        IProblem problem = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as IProblem;
    291291        if (e.Effect.HasFlag(DragDropEffects.Copy)) problem = (IProblem)problem.Clone();
    292292        Content.Problem = problem;
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/BatchRunView.cs

    r5744 r5837  
    253253    private void optimizerTabPage_DragEnterOver(object sender, DragEventArgs e) {
    254254      e.Effect = DragDropEffects.None;
    255       if (!ReadOnly && (e.Data.GetData("HeuristicLab") is IOptimizer)) {
     255      if (!ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IOptimizer)) {
    256256        if ((e.KeyState & 32) == 32) e.Effect = DragDropEffects.Link;  // ALT key
    257257        else if ((e.KeyState & 4) == 4) e.Effect = DragDropEffects.Move;  // SHIFT key
     
    263263    private void optimizerTabPage_DragDrop(object sender, DragEventArgs e) {
    264264      if (e.Effect != DragDropEffects.None) {
    265         IOptimizer optimizer = e.Data.GetData("HeuristicLab") as IOptimizer;
     265        IOptimizer optimizer = e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) as IOptimizer;
    266266        if (e.Effect.HasFlag(DragDropEffects.Copy)) optimizer = (IOptimizer)optimizer.Clone();
    267267        Content.Optimizer = optimizer;
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionBubbleChartView.cs

    r5824 r5837  
    493493        if (this.draggedRun != null && h.ChartElementType != ChartElementType.DataPoint) {
    494494          DataObject data = new DataObject();
    495           data.SetData("HeuristicLab", draggedRun);
     495          data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, draggedRun);
    496496          if (ReadOnly)
    497497            DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link);
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunCollectionView.cs

    r5744 r5837  
    273273        if (items.Count > 0) {
    274274          DataObject data = new DataObject();
    275           if (items.Count == 1) data.SetData("HeuristicLab", items[0]);
    276           else data.SetData("HeuristicLab", items);
     275          if (items.Count == 1) data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, items[0]);
     276          else data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, items);
    277277          if (Content.IsReadOnly || ReadOnly) {
    278278            DoDragDrop(data, DragDropEffects.Copy | DragDropEffects.Link);
     
    288288    private void itemsListView_DragEnter(object sender, DragEventArgs e) {
    289289      validDragOperation = false;
    290       if (e.Data.GetData("HeuristicLab") is IRun) {
     290      if (!Content.IsReadOnly && !ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IRun)) {
    291291        validDragOperation = true;
    292       } else if (e.Data.GetData("HeuristicLab") is IEnumerable) {
     292      } else if (!Content.IsReadOnly && !ReadOnly && (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable)) {
    293293        validDragOperation = true;
    294         IEnumerable items = (IEnumerable)e.Data.GetData("HeuristicLab");
     294        IEnumerable items = (IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    295295        foreach (object item in items)
    296296          validDragOperation = validDragOperation && (item is IRun);
    297297      }
    298       validDragOperation = validDragOperation && !Content.IsReadOnly && !ReadOnly;
    299298    }
    300299    private void itemsListView_DragOver(object sender, DragEventArgs e) {
     
    310309    private void itemsListView_DragDrop(object sender, DragEventArgs e) {
    311310      if (e.Effect != DragDropEffects.None) {
    312         if (e.Data.GetData("HeuristicLab") is IRun) {
    313           IRun item = (IRun)e.Data.GetData("HeuristicLab");
     311        if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IRun) {
     312          IRun item = (IRun)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat);
    314313          Content.Add(e.Effect.HasFlag(DragDropEffects.Copy) ? (IRun)item.Clone() : item);
    315         } else if (e.Data.GetData("HeuristicLab") is IEnumerable) {
    316           IEnumerable<IRun> items = ((IEnumerable)e.Data.GetData("HeuristicLab")).Cast<IRun>();
     314        } else if (e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat) is IEnumerable) {
     315          IEnumerable<IRun> items = ((IEnumerable)e.Data.GetData(HeuristicLab.Common.Constants.DragDropDataFormat)).Cast<IRun>();
    317316          foreach (IRun item in items)
    318317            Content.Add(e.Effect.HasFlag(DragDropEffects.Copy) ? (IRun)item.Clone() : item);
  • trunk/sources/HeuristicLab.Optimization.Views/3.3/RunView.cs

    r5744 r5837  
    149149        if (item != null) {
    150150          DataObject data = new DataObject();
    151           data.SetData("HeuristicLab", item);
     151          data.SetData(HeuristicLab.Common.Constants.DragDropDataFormat, item);
    152152          DragDropEffects result = DoDragDrop(data, DragDropEffects.Copy);
    153153        }
Note: See TracChangeset for help on using the changeset viewer.