Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/12 21:23:36 (13 years ago)
Author:
abeham
Message:

#1614

  • Added a property ReferencePublication
  • Added a custom combobox that can display a tooltip for each item
  • Added tooltip for the different providers stating link and reference publication
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP/HeuristicLab.Problems.GeneralizedQuadraticAssignment.Views/3.3/ProblemView.cs

    r7448 r7482  
    6161
    6262    private void problemInstanceProviderComboBox_SelectedIndexChanged(object sender, System.EventArgs e) {
    63       var provider = (IProblemInstanceProvider)problemInstanceProviderComboBox.SelectedItem;
    64       provider.SetConsumer((IProblemInstanceConsumer)Content);
    65       problemInstanceProviderViewHost.Content = provider;
     63      if (problemInstanceProviderComboBox.SelectedIndex >= 0) {
     64        var provider = (IProblemInstanceProvider)problemInstanceProviderComboBox.SelectedItem;
     65        provider.SetConsumer((IProblemInstanceConsumer)Content);
     66        problemInstanceProviderViewHost.Content = provider;
     67        toolTip.SetToolTip(problemInstanceProviderComboBox, GetProviderToolTip(provider));
     68      }
    6669    }
    6770
     
    8891      }
    8992    }
     93
     94    protected virtual string GetProviderToolTip(IProblemInstanceProvider provider) {
     95      return provider.Name
     96          + Environment.NewLine
     97          + provider.WebLink.ToString()
     98          + Environment.NewLine + Environment.NewLine
     99          + provider.ReferencePublication;
     100    }
     101
     102    private void problemInstanceProviderComboBox_ToolTipRequired(object sender, ToolTipRequiredEventArgs e) {
     103      e.ToolTip = GetProviderToolTip((IProblemInstanceProvider)e.Item);
     104    }
    90105  }
    91106}
Note: See TracChangeset for help on using the changeset viewer.