Free cookie consent management tool by TermsFeed Policy Generator

Changeset 4447


Ignore:
Timestamp:
09/20/10 10:41:15 (14 years ago)
Author:
mkommend
Message:

Corrected saving of items in the Clipboard (ticket #1155).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core.Views/3.3/Clipboard.cs

    r4435 r4447  
    178178
    179179      int i = 0;
    180       T[] items = itemListViewItemTable.Keys.ToArray();
     180      var query = from item in itemListViewItemTable.Keys
     181                  let views = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v.Content == item)
     182                  where !views.Any(v => v.Locked)
     183                  select item;
     184      T[] items = query.ToArray();
     185
    181186      foreach (T item in items) {
    182187        try {
     
    187192        }
    188193        catch (Exception) { }
     194        finally {
     195          SetEnabledStateOfContentViews(item, true);
     196        }
    189197      }
    190198      OnAllItemsSaved();
     
    196204        else {
    197205          progressBar.Value += progress;
    198           SetEnabledStateOfContentViews(item, true);
    199206        }
    200207      }
     
    314321    }
    315322    private void saveButton_Click(object sender, EventArgs e) {
     323      var query = (from item in itemListViewItemTable.Keys
     324                   let views = MainFormManager.MainForm.Views.OfType<IContentView>().Where(v => v.Content == item)
     325                   where views.Any(v => v.Locked)
     326                   select item.ToString()).ToArray();
     327      if (query.Length != 0) {
     328        string itemNames = string.Join(Environment.NewLine, query);
     329        MessageBox.Show("Could not save the following items, because they are locked (e.g. used in a running algorithm). All other items will be saved." + Environment.NewLine + itemNames);
     330      }
    316331      Save();
    317332    }
Note: See TracChangeset for help on using the changeset viewer.