Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/24/10 10:24:20 (14 years ago)
Author:
gkronber
Message:

Preparations for next HL release. #1203

Location:
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced
Files:
1 deleted
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/AvailablePluginsView.cs

    r4068 r4482  
    311311    }
    312312
    313     private bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
     313    private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
    314314      // newer: build version is higher, or if build version is the same revision is higher
    315315      if (plugin1.Version.Build < plugin2.Version.Build) return false;
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/BasicUpdateView.cs

    r4068 r4482  
    8787    }
    8888
    89     private bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
     89    private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
    9090      // newer: build version is higher, or if build version is the same revision is higher
    9191      if (plugin1.Version.Build < plugin2.Version.Build) return false;
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/DeploymentService/PluginDescription.cs

    r4068 r4482  
    6969    }
    7070
    71     [Obsolete]
    72     public DateTime BuildDate {
    73       get { throw new NotImplementedException(); }
    74     }
    75 
    7671    /// <summary>
    7772    /// Gets an enumerable of dependencies of the plugin
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/EditProductsView.cs

    r4068 r4482  
    257257
    258258        // populate plugins list view
    259         ListViewItem activeItem = (ListViewItem)productsListView.SelectedItems[0];
    260259        pluginListView.SuppressItemCheckedEvents = true;
    261260        foreach (var plugin in plugins.OfType<IPluginDescription>()) {
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManager.cs

    r4068 r4482  
    179179      using (ZipInputStream s = new ZipInputStream(new MemoryStream(zippedPackage))) {
    180180        ZipEntry theEntry;
    181         string tmpEntry = String.Empty;
    182181        while ((theEntry = s.GetNextEntry()) != null) {
    183182          string directoryName = pluginDir;
    184183          string fileName = Path.GetFileName(theEntry.Name);
    185184          // create directory
    186           if (directoryName != "") {
     185          if (!string.IsNullOrEmpty(directoryName)) {
    187186            Directory.CreateDirectory(directoryName);
    188187          }
    189           if (fileName != String.Empty) {
     188          if (!string.IsNullOrEmpty(fileName)) {
    190189            string fullPath = Path.Combine(directoryName, fileName);
    191190            string fullDirPath = Path.GetDirectoryName(fullPath);
    192191            if (!Directory.Exists(fullDirPath)) Directory.CreateDirectory(fullDirPath);
    193             FileStream streamWriter = File.Create(fullPath);
    194             int size = 2048;
    195             byte[] data = new byte[2048];
    196             while (true) {
    197               size = s.Read(data, 0, data.Length);
    198               if (size > 0) {
    199                 streamWriter.Write(data, 0, size);
    200               } else {
    201                 break;
     192            using (FileStream streamWriter = File.Create(fullPath)) {
     193              int size = 2048;
     194              byte[] data = new byte[2048];
     195              while (true) {
     196                size = s.Read(data, 0, data.Length);
     197                if (size > 0) {
     198                  streamWriter.Write(data, 0, size);
     199                } else {
     200                  break;
     201                }
    202202              }
     203              streamWriter.Close();
    203204            }
    204             streamWriter.Close();
    205205          }
    206206        }
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerException.cs

    r4068 r4482  
    2929    public InstallationManagerException(string msg) : base(msg) { }
    3030    public InstallationManagerException(string msg, Exception e) : base(msg, e) { }
    31     public InstallationManagerException(SerializationInfo info, StreamingContext context) : base(info, context) { }
     31    protected InstallationManagerException(SerializationInfo info, StreamingContext context) : base(info, context) { }
    3232  }
    3333}
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.cs

    r4068 r4482  
    3232  internal partial class InstallationManagerForm : Form, IStatusView {
    3333    private InstallationManager installationManager;
    34     private PluginManager pluginManager;
    3534    private string pluginDir;
    3635
     
    4039      FileVersionInfo pluginInfrastructureVersion = FileVersionInfo.GetVersionInfo(GetType().Assembly.Location);
    4140      Text = "HeuristicLab Plugin Manager " + pluginInfrastructureVersion.FileVersion;
    42 
    43       this.pluginManager = pluginManager;
    4441
    4542      pluginManager.PluginLoaded += pluginManager_PluginLoaded;
     
    142139    #region button events
    143140    private void connectionSettingsToolStripMenuItem_Click(object sender, EventArgs e) {
    144       new ConnectionSetupView().ShowDialog(this);
     141      using (var conSetupView = new ConnectionSetupView()) {
     142        conSetupView.ShowDialog(this);
     143      }
    145144    }
    146145    private void tabControl_SelectedIndexChanged(object sender, EventArgs e) {
     
    157156        }
    158157      }
    159       return (new ConfirmationDialog("Confirm Delete", "Do you want to delete following files?", strBuilder.ToString())).ShowDialog(this) == DialogResult.OK;
     158      using (var confirmationDialog = new ConfirmationDialog("Confirm Delete", "Do you want to delete following files?", strBuilder.ToString())) {
     159        return (confirmationDialog.ShowDialog(this)) == DialogResult.OK;
     160      }
    160161    }
    161162
     
    165166        strBuilder.AppendLine(plugin.ToString());
    166167      }
    167       return (new ConfirmationDialog("Confirm Update", "Do you want to update following plugins?", strBuilder.ToString())).ShowDialog(this) == DialogResult.OK;
     168      using (var confirmationDialog = new ConfirmationDialog("Confirm Update", "Do you want to update following plugins?", strBuilder.ToString())) {
     169        return (confirmationDialog.ShowDialog(this)) == DialogResult.OK;
     170      }
    168171    }
    169172
     
    171174      foreach (var plugin in plugins) {
    172175        if (!string.IsNullOrEmpty(plugin.LicenseText)) {
    173           var licenseConfirmationBox = new LicenseConfirmationDialog(plugin);
    174           if (licenseConfirmationBox.ShowDialog(this) != DialogResult.OK)
    175             return false;
     176          using (var licenseConfirmationBox = new LicenseConfirmationDialog(plugin)) {
     177            if (licenseConfirmationBox.ShowDialog(this) != DialogResult.OK)
     178              return false;
     179          }
    176180        }
    177181      }
     
    207211
    208212    public void ShowProgressIndicator(double percentProgress) {
    209       if (percentProgress < 0.0 || percentProgress > 1.0) throw new ArgumentException();
     213      if (percentProgress < 0.0 || percentProgress > 1.0) throw new ArgumentException("percentProgress");
    210214      toolStripProgressBar.Visible = true;
    211215      toolStripProgressBar.Style = ProgressBarStyle.Continuous;
     
    224228
    225229    public void ShowMessage(string message) {
    226       if (toolStripStatusLabel.Text == string.Empty)
     230      if (string.IsNullOrEmpty(toolStripStatusLabel.Text))
    227231        toolStripStatusLabel.Text = message;
    228232      else
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstalledPluginsView.cs

    r4068 r4482  
    120120    }
    121121
    122     private bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
     122    private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {
    123123      // newer: build version is higher, or if build version is the same revision is higher
    124124      if (plugin1.Version.Build < plugin2.Version.Build) return false;
     
    153153    }
    154154
    155     private ListViewItem CreateListViewItem(PluginDescription plugin) {
     155    private static ListViewItem CreateListViewItem(PluginDescription plugin) {
    156156      ListViewItem item = new ListViewItem(new string[] { plugin.Name, plugin.Version.ToString(), plugin.Description });
    157157      item.Tag = plugin;
     
    190190        List<ListViewItem> modifiedItems = new List<ListViewItem>();
    191191        foreach (ListViewItem item in localPluginsListView.SelectedItems) {
    192           var plugin = (IPluginDescription)item.Tag;
    193192          modifiedItems.Add(item);
    194193        }
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/MultiSelectListView.cs

    r4068 r4482  
    2222using System.Linq;
    2323using System.Windows.Forms;
     24using System;
    2425
    2526namespace HeuristicLab.PluginInfrastructure.Advanced {
     
    4344    // and then one the item whose checkbox was clicked
    4445    protected override void OnItemCheck(ItemCheckEventArgs ice) {
     46      if (ice == null) throw new ArgumentNullException("ice");
    4547      // don't change the checked state of items that were not clicked directly
    4648      if (inhibitAutoCheck) {
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/UploadPluginsView.cs

    r4068 r4482  
    260260    }
    261261
    262     private byte[] CreateZipPackage(IPluginDescription plugin) {
     262    private static byte[] CreateZipPackage(IPluginDescription plugin) {
    263263      using (MemoryStream stream = new MemoryStream()) {
    264264        ZipFile zipFile = new ZipFile(stream);
Note: See TracChangeset for help on using the changeset viewer.