- Timestamp:
- 09/24/10 10:24:20 (14 years ago)
- 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 311 311 } 312 312 313 private bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {313 private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) { 314 314 // newer: build version is higher, or if build version is the same revision is higher 315 315 if (plugin1.Version.Build < plugin2.Version.Build) return false; -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/BasicUpdateView.cs
r4068 r4482 87 87 } 88 88 89 private bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {89 private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) { 90 90 // newer: build version is higher, or if build version is the same revision is higher 91 91 if (plugin1.Version.Build < plugin2.Version.Build) return false; -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/DeploymentService/PluginDescription.cs
r4068 r4482 69 69 } 70 70 71 [Obsolete]72 public DateTime BuildDate {73 get { throw new NotImplementedException(); }74 }75 76 71 /// <summary> 77 72 /// Gets an enumerable of dependencies of the plugin -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/EditProductsView.cs
r4068 r4482 257 257 258 258 // populate plugins list view 259 ListViewItem activeItem = (ListViewItem)productsListView.SelectedItems[0];260 259 pluginListView.SuppressItemCheckedEvents = true; 261 260 foreach (var plugin in plugins.OfType<IPluginDescription>()) { -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManager.cs
r4068 r4482 179 179 using (ZipInputStream s = new ZipInputStream(new MemoryStream(zippedPackage))) { 180 180 ZipEntry theEntry; 181 string tmpEntry = String.Empty;182 181 while ((theEntry = s.GetNextEntry()) != null) { 183 182 string directoryName = pluginDir; 184 183 string fileName = Path.GetFileName(theEntry.Name); 185 184 // create directory 186 if ( directoryName != "") {185 if (!string.IsNullOrEmpty(directoryName)) { 187 186 Directory.CreateDirectory(directoryName); 188 187 } 189 if ( fileName != String.Empty) {188 if (!string.IsNullOrEmpty(fileName)) { 190 189 string fullPath = Path.Combine(directoryName, fileName); 191 190 string fullDirPath = Path.GetDirectoryName(fullPath); 192 191 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 } 202 202 } 203 streamWriter.Close(); 203 204 } 204 streamWriter.Close();205 205 } 206 206 } -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerException.cs
r4068 r4482 29 29 public InstallationManagerException(string msg) : base(msg) { } 30 30 public InstallationManagerException(string msg, Exception e) : base(msg, e) { } 31 p ublicInstallationManagerException(SerializationInfo info, StreamingContext context) : base(info, context) { }31 protected InstallationManagerException(SerializationInfo info, StreamingContext context) : base(info, context) { } 32 32 } 33 33 } -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstallationManagerForm.cs
r4068 r4482 32 32 internal partial class InstallationManagerForm : Form, IStatusView { 33 33 private InstallationManager installationManager; 34 private PluginManager pluginManager;35 34 private string pluginDir; 36 35 … … 40 39 FileVersionInfo pluginInfrastructureVersion = FileVersionInfo.GetVersionInfo(GetType().Assembly.Location); 41 40 Text = "HeuristicLab Plugin Manager " + pluginInfrastructureVersion.FileVersion; 42 43 this.pluginManager = pluginManager;44 41 45 42 pluginManager.PluginLoaded += pluginManager_PluginLoaded; … … 142 139 #region button events 143 140 private void connectionSettingsToolStripMenuItem_Click(object sender, EventArgs e) { 144 new ConnectionSetupView().ShowDialog(this); 141 using (var conSetupView = new ConnectionSetupView()) { 142 conSetupView.ShowDialog(this); 143 } 145 144 } 146 145 private void tabControl_SelectedIndexChanged(object sender, EventArgs e) { … … 157 156 } 158 157 } 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 } 160 161 } 161 162 … … 165 166 strBuilder.AppendLine(plugin.ToString()); 166 167 } 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 } 168 171 } 169 172 … … 171 174 foreach (var plugin in plugins) { 172 175 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 } 176 180 } 177 181 } … … 207 211 208 212 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"); 210 214 toolStripProgressBar.Visible = true; 211 215 toolStripProgressBar.Style = ProgressBarStyle.Continuous; … … 224 228 225 229 public void ShowMessage(string message) { 226 if ( toolStripStatusLabel.Text == string.Empty)230 if (string.IsNullOrEmpty(toolStripStatusLabel.Text)) 227 231 toolStripStatusLabel.Text = message; 228 232 else -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/InstalledPluginsView.cs
r4068 r4482 120 120 } 121 121 122 private bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) {122 private static bool IsNewerThan(IPluginDescription plugin1, IPluginDescription plugin2) { 123 123 // newer: build version is higher, or if build version is the same revision is higher 124 124 if (plugin1.Version.Build < plugin2.Version.Build) return false; … … 153 153 } 154 154 155 private ListViewItem CreateListViewItem(PluginDescription plugin) {155 private static ListViewItem CreateListViewItem(PluginDescription plugin) { 156 156 ListViewItem item = new ListViewItem(new string[] { plugin.Name, plugin.Version.ToString(), plugin.Description }); 157 157 item.Tag = plugin; … … 190 190 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 191 191 foreach (ListViewItem item in localPluginsListView.SelectedItems) { 192 var plugin = (IPluginDescription)item.Tag;193 192 modifiedItems.Add(item); 194 193 } -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/MultiSelectListView.cs
r4068 r4482 22 22 using System.Linq; 23 23 using System.Windows.Forms; 24 using System; 24 25 25 26 namespace HeuristicLab.PluginInfrastructure.Advanced { … … 43 44 // and then one the item whose checkbox was clicked 44 45 protected override void OnItemCheck(ItemCheckEventArgs ice) { 46 if (ice == null) throw new ArgumentNullException("ice"); 45 47 // don't change the checked state of items that were not clicked directly 46 48 if (inhibitAutoCheck) { -
trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Advanced/UploadPluginsView.cs
r4068 r4482 260 260 } 261 261 262 private byte[] CreateZipPackage(IPluginDescription plugin) {262 private static byte[] CreateZipPackage(IPluginDescription plugin) { 263 263 using (MemoryStream stream = new MemoryStream()) { 264 264 ZipFile zipFile = new ZipFile(stream);
Note: See TracChangeset
for help on using the changeset viewer.