Changeset 3068 for trunk/sources
- Timestamp:
- 03/16/10 17:14:35 (15 years ago)
- Location:
- trunk/sources/HeuristicLab.PluginInfrastructure
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/ConnectionSetupView.cs
r3006 r3068 47 47 form = new Form(); 48 48 form.Name = this.Name; 49 form.Size = this.Size; 49 50 this.Dock = DockStyle.Fill; 50 51 form.Controls.Add(this); -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LocalPluginManager.Designer.cs
r3006 r3068 26 26 this.components = new System.ComponentModel.Container(); 27 27 System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Active Plugins", System.Windows.Forms.HorizontalAlignment.Left); 28 System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Disabled Plugins", System.Windows.Forms.HorizontalAlignment.Left); 29 this.localPluginsListView = new System.Windows.Forms.ListView(); 30 this.pluginNameHeader = new System.Windows.Forms.ColumnHeader(); 28 System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Inactive Plugins", System.Windows.Forms.HorizontalAlignment.Left); 29 this.imageListForLocalItems = new System.Windows.Forms.ImageList(this.components); 30 this.localPluginsListView = new HeuristicLab.PluginInfrastructure.Advanced.MultiSelectListView(); 31 this.nameHeader = new System.Windows.Forms.ColumnHeader(); 31 32 this.versionHeader = new System.Windows.Forms.ColumnHeader(); 32 this.pluginDescriptionHeader = new System.Windows.Forms.ColumnHeader(); 33 this.imageListForLocalItems = new System.Windows.Forms.ImageList(this.components); 33 this.descriptionHeader = new System.Windows.Forms.ColumnHeader(); 34 34 this.SuspendLayout(); 35 // 36 // imageListForLocalItems 37 // 38 this.imageListForLocalItems.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; 39 this.imageListForLocalItems.ImageSize = new System.Drawing.Size(13, 13); 40 this.imageListForLocalItems.TransparentColor = System.Drawing.Color.Transparent; 35 41 // 36 42 // localPluginsListView … … 38 44 this.localPluginsListView.CheckBoxes = true; 39 45 this.localPluginsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 40 this. pluginNameHeader,46 this.nameHeader, 41 47 this.versionHeader, 42 this. pluginDescriptionHeader});48 this.descriptionHeader}); 43 49 this.localPluginsListView.Dock = System.Windows.Forms.DockStyle.Fill; 44 this.localPluginsListView.FullRowSelect = true;45 50 listViewGroup1.Header = "Active Plugins"; 46 51 listViewGroup1.Name = "activePluginsGroup"; 47 listViewGroup2.Header = " DisabledPlugins";48 listViewGroup2.Name = " disabledPluginsGroup";52 listViewGroup2.Header = "Inactive Plugins"; 53 listViewGroup2.Name = "inactivePluginsGroup"; 49 54 this.localPluginsListView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { 50 55 listViewGroup1, … … 54 59 this.localPluginsListView.Size = new System.Drawing.Size(570, 547); 55 60 this.localPluginsListView.StateImageList = this.imageListForLocalItems; 56 this.localPluginsListView.TabIndex = 8; 61 this.localPluginsListView.SuppressItemCheckedEvents = false; 62 this.localPluginsListView.TabIndex = 9; 57 63 this.localPluginsListView.UseCompatibleStateImageBehavior = false; 58 64 this.localPluginsListView.View = System.Windows.Forms.View.Details; … … 60 66 this.localPluginsListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.pluginsListView_ItemChecked); 61 67 // 62 // pluginNameHeader68 // nameHeader 63 69 // 64 this. pluginNameHeader.Text = "Name";65 this. pluginNameHeader.Width = 220;70 this.nameHeader.Text = "Name"; 71 this.nameHeader.Width = 155; 66 72 // 67 73 // versionHeader 68 74 // 69 75 this.versionHeader.Text = "Version"; 70 this.versionHeader.Width = 120;76 this.versionHeader.Width = 92; 71 77 // 72 // pluginDescriptionHeader78 // descriptionHeader 73 79 // 74 this.pluginDescriptionHeader.Text = "Description"; 75 this.pluginDescriptionHeader.Width = 243; 76 // 77 // imageListForLocalItems 78 // 79 this.imageListForLocalItems.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; 80 this.imageListForLocalItems.ImageSize = new System.Drawing.Size(13, 13); 81 this.imageListForLocalItems.TransparentColor = System.Drawing.Color.Transparent; 80 this.descriptionHeader.Text = "Description"; 81 this.descriptionHeader.Width = 316; 82 82 // 83 83 // LocalPluginManager … … 94 94 #endregion 95 95 96 private System.Windows.Forms.ListView localPluginsListView; 97 private System.Windows.Forms.ColumnHeader pluginNameHeader; 96 private System.Windows.Forms.ImageList imageListForLocalItems; 97 private MultiSelectListView localPluginsListView; 98 private System.Windows.Forms.ColumnHeader nameHeader; 98 99 private System.Windows.Forms.ColumnHeader versionHeader; 99 private System.Windows.Forms.ColumnHeader pluginDescriptionHeader; 100 private System.Windows.Forms.ImageList imageListForLocalItems; 100 private System.Windows.Forms.ColumnHeader descriptionHeader; 101 101 } 102 102 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/LocalPluginManager.cs
r3006 r3068 52 52 private void UpdateControl() { 53 53 ClearPluginList(); 54 localPluginsListView.SuppressItemCheckedEvents = true; 54 55 foreach (var plugin in plugins) { 55 56 var item = CreateListViewItem(plugin); … … 61 62 localPluginsListView.Items.Add(item); 62 63 } 64 localPluginsListView.SuppressItemCheckedEvents = false; 63 65 } 64 66 … … 78 80 // checked items are marked for removal 79 81 if (e.Item.Checked) { 80 var plugin = (IPluginDescription)e.Item.Tag; 81 foreach (ListViewItem item in localPluginsListView.Items) { 82 var dep = (IPluginDescription)item.Tag; 83 if (!item.Checked && dep.Dependencies.Contains(plugin)) { 84 item.Checked = true; 82 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 83 foreach (ListViewItem item in localPluginsListView.SelectedItems) { 84 var plugin = (IPluginDescription)item.Tag; 85 modifiedItems.Add(item); 86 // also uncheck all dependent plugins 87 foreach (ListViewItem dependentItem in localPluginsListView.Items) { 88 var dependent = (IPluginDescription)dependentItem.Tag; 89 if (!dependentItem.Checked && (from dep in dependent.Dependencies 90 where dep.Name == plugin.Name 91 where dep.Version == plugin.Version 92 select dep).Any()) { 93 modifiedItems.Add(dependentItem); 94 } 85 95 } 86 96 } 97 localPluginsListView.CheckItems(modifiedItems); 98 } else { 99 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 100 foreach (ListViewItem item in localPluginsListView.SelectedItems) { 101 var plugin = (IPluginDescription)item.Tag; 102 modifiedItems.Add(item); 103 } 104 localPluginsListView.UncheckItems(modifiedItems); 87 105 } 88 106 OnItemChecked(e); -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/RemotePluginInstaller.Designer.cs
r2922 r3068 25 25 private void InitializeComponent() { 26 26 this.components = new System.ComponentModel.Container(); 27 System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Available Products", System.Windows.Forms.HorizontalAlignment.Left); 28 System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("Available Plugins (Most Recent Version)", System.Windows.Forms.HorizontalAlignment.Left); 29 System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("Available Plugins (All Versions)", System.Windows.Forms.HorizontalAlignment.Left); 30 this.remotePluginsListView = new System.Windows.Forms.ListView(); 31 this.columnHeader1 = new System.Windows.Forms.ColumnHeader(); 32 this.columnHeader2 = new System.Windows.Forms.ColumnHeader(); 33 this.columnHeader3 = new System.Windows.Forms.ColumnHeader(); 27 System.Windows.Forms.ListViewGroup listViewGroup1 = new System.Windows.Forms.ListViewGroup("Products", System.Windows.Forms.HorizontalAlignment.Left); 28 System.Windows.Forms.ListViewGroup listViewGroup2 = new System.Windows.Forms.ListViewGroup("New Plugins", System.Windows.Forms.HorizontalAlignment.Left); 29 System.Windows.Forms.ListViewGroup listViewGroup3 = new System.Windows.Forms.ListViewGroup("All Plugins", System.Windows.Forms.HorizontalAlignment.Left); 34 30 this.imageListForRemoteItems = new System.Windows.Forms.ImageList(this.components); 31 this.remotePluginsListView = new HeuristicLab.PluginInfrastructure.Advanced.MultiSelectListView(); 32 this.nameHeader = new System.Windows.Forms.ColumnHeader(); 33 this.versionHeader = new System.Windows.Forms.ColumnHeader(); 34 this.descriptionHeader = new System.Windows.Forms.ColumnHeader(); 35 35 this.SuspendLayout(); 36 // 37 // imageListForRemoteItems 38 // 39 this.imageListForRemoteItems.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; 40 this.imageListForRemoteItems.ImageSize = new System.Drawing.Size(13, 13); 41 this.imageListForRemoteItems.TransparentColor = System.Drawing.Color.Transparent; 36 42 // 37 43 // remotePluginsListView … … 39 45 this.remotePluginsListView.CheckBoxes = true; 40 46 this.remotePluginsListView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { 41 this. columnHeader1,42 this. columnHeader2,43 this. columnHeader3});47 this.nameHeader, 48 this.versionHeader, 49 this.descriptionHeader}); 44 50 this.remotePluginsListView.Dock = System.Windows.Forms.DockStyle.Fill; 45 this.remotePluginsListView.FullRowSelect = true; 46 listViewGroup1.Header = "Available Products"; 51 listViewGroup1.Header = "Products"; 47 52 listViewGroup1.Name = "productsGroup"; 48 listViewGroup2.Header = " Available Plugins (Most Recent Version)";53 listViewGroup2.Header = "New Plugins"; 49 54 listViewGroup2.Name = "newPluginsGroup"; 50 listViewGroup3.Header = "A vailable Plugins (All Versions)";55 listViewGroup3.Header = "All Plugins"; 51 56 listViewGroup3.Name = "allPluginsGroup"; 52 57 this.remotePluginsListView.Groups.AddRange(new System.Windows.Forms.ListViewGroup[] { … … 58 63 this.remotePluginsListView.Size = new System.Drawing.Size(533, 558); 59 64 this.remotePluginsListView.StateImageList = this.imageListForRemoteItems; 60 this.remotePluginsListView.TabIndex = 10; 65 this.remotePluginsListView.SuppressItemCheckedEvents = false; 66 this.remotePluginsListView.TabIndex = 0; 61 67 this.remotePluginsListView.UseCompatibleStateImageBehavior = false; 62 68 this.remotePluginsListView.View = System.Windows.Forms.View.Details; 63 69 this.remotePluginsListView.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.remotePluginsListView_ItemChecked); 64 70 // 65 // columnHeader171 // nameHeader 66 72 // 67 this. columnHeader1.Text = "Name";68 this. columnHeader1.Width = 220;73 this.nameHeader.Text = "Name"; 74 this.nameHeader.Width = 115; 69 75 // 70 // columnHeader276 // versionHeader 71 77 // 72 this. columnHeader2.Text = "Version";73 this. columnHeader2.Width = 120;78 this.versionHeader.Text = "Version"; 79 this.versionHeader.Width = 161; 74 80 // 75 // columnHeader381 // descriptionHeader 76 82 // 77 this.columnHeader3.Text = "Description"; 78 this.columnHeader3.Width = 240; 79 // 80 // imageListForRemoteItems 81 // 82 this.imageListForRemoteItems.ColorDepth = System.Windows.Forms.ColorDepth.Depth32Bit; 83 this.imageListForRemoteItems.ImageSize = new System.Drawing.Size(13, 13); 84 this.imageListForRemoteItems.TransparentColor = System.Drawing.Color.Transparent; 83 this.descriptionHeader.Text = "Description"; 84 this.descriptionHeader.Width = 250; 85 85 // 86 86 // RemotePluginInstaller … … 97 97 #endregion 98 98 99 private System.Windows.Forms.ListView remotePluginsListView;100 private System.Windows.Forms.ColumnHeader columnHeader1;101 private System.Windows.Forms.ColumnHeader columnHeader2;102 private System.Windows.Forms.ColumnHeader columnHeader3;103 99 private System.Windows.Forms.ImageList imageListForRemoteItems; 100 private MultiSelectListView remotePluginsListView; 101 private System.Windows.Forms.ColumnHeader nameHeader; 102 private System.Windows.Forms.ColumnHeader versionHeader; 103 private System.Windows.Forms.ColumnHeader descriptionHeader; 104 104 } 105 105 } -
trunk/sources/HeuristicLab.PluginInfrastructure/Advanced/RemotePluginInstaller.cs
r2922 r3068 72 72 private void UpdateControl() { 73 73 ClearListView(); 74 74 remotePluginsListView.SuppressItemCheckedEvents = true; 75 75 foreach (var newPlugin in NewPlugins) { 76 76 var item = CreateListViewItem(newPlugin); … … 90 90 remotePluginsListView.Items.Add(item); 91 91 } 92 remotePluginsListView.SuppressItemCheckedEvents = false; 92 93 } 93 94 … … 111 112 #region item checked event handler 112 113 private void remotePluginsListView_ItemChecked(object sender, ItemCheckedEventArgs e) { 113 // dispatch by check state and type of item (product/plugin) 114 IPluginDescription plugin = e.Item.Tag as IPluginDescription; 115 if (plugin != null) 116 if (e.Item.Checked) 117 HandlePluginChecked(plugin); 118 else 119 HandlePluginUnchecked(plugin); 120 else { 121 DeploymentService.ProductDescription product = e.Item.Tag as DeploymentService.ProductDescription; 122 if (product != null) 114 foreach (ListViewItem item in remotePluginsListView.SelectedItems) { 115 // dispatch by check state and type of item (product/plugin) 116 IPluginDescription plugin = item.Tag as IPluginDescription; 117 if (plugin != null) 123 118 if (e.Item.Checked) 124 HandleP roductChecked(product);119 HandlePluginChecked(plugin); 125 120 else 126 HandleProductUnchecked(product); 121 HandlePluginUnchecked(plugin); 122 else { 123 DeploymentService.ProductDescription product = item.Tag as DeploymentService.ProductDescription; 124 if (product != null) 125 if (e.Item.Checked) 126 HandleProductChecked(product); 127 else 128 HandleProductUnchecked(product); 129 } 127 130 } 128 131 OnItemChecked(e); … … 131 134 private void HandleProductUnchecked(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription product) { 132 135 // also uncheck the plugins of the product 136 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 137 modifiedItems.Add(FindItemForProduct(product)); 133 138 foreach (var plugin in product.Plugins) { 134 139 var item = FindItemForPlugin(plugin); 135 140 if (item != null && item.Checked) 136 item.Checked = false; 137 } 141 modifiedItems.Add(item); 142 } 143 remotePluginsListView.UncheckItems(modifiedItems); 138 144 } 139 145 140 146 private void HandleProductChecked(HeuristicLab.PluginInfrastructure.Advanced.DeploymentService.ProductDescription product) { 141 147 // also check all plugins of the product 148 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 149 modifiedItems.Add(FindItemForProduct(product)); 142 150 foreach (var plugin in product.Plugins) { 143 151 var item = FindItemForPlugin(plugin); 144 152 if (item != null && !item.Checked) { 145 item.Checked = true; 146 } 147 } 153 modifiedItems.Add(item); 154 } 155 } 156 remotePluginsListView.CheckItems(modifiedItems); 148 157 } 149 158 150 159 private void HandlePluginUnchecked(IPluginDescription plugin) { 151 160 // also uncheck all dependent plugins 161 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 162 modifiedItems.Add(FindItemForPlugin(plugin)); 152 163 var dependentPlugins = from otherPlugin in plugins 153 164 where otherPlugin.Dependencies.Any(dep => dep.Name == plugin.Name && dep.Version == plugin.Version) … … 156 167 var item = FindItemForPlugin(dependentPlugin); 157 168 if (item != null && item.Checked) { 158 item.Checked = false;169 modifiedItems.Add(item); 159 170 } 160 171 } … … 166 177 var item = FindItemForProduct(dependentProduct); 167 178 if (item != null && item.Checked) { 168 item.Checked = false; 169 } 170 } 179 modifiedItems.Add(item); 180 } 181 } 182 remotePluginsListView.UncheckItems(modifiedItems); 171 183 } 172 184 173 185 private void HandlePluginChecked(IPluginDescription plugin) { 174 186 // also check all dependencies 187 List<ListViewItem> modifiedItems = new List<ListViewItem>(); 188 modifiedItems.Add(FindItemForPlugin(plugin)); 175 189 foreach (var dep in plugin.Dependencies) { 176 190 var item = FindItemForPlugin(dep); 177 191 if (item != null && !item.Checked) { 178 item.Checked = true; 179 } 180 } 192 modifiedItems.Add(item); 193 } 194 } 195 remotePluginsListView.CheckItems(modifiedItems); 181 196 } 182 197 -
trunk/sources/HeuristicLab.PluginInfrastructure/HeuristicLab.PluginInfrastructure.csproj
r3006 r3068 139 139 <Compile Include="Advanced\InstallationManagerControl.Designer.cs"> 140 140 <DependentUpon>InstallationManagerControl.cs</DependentUpon> 141 </Compile> 142 <Compile Include="Advanced\MultiSelectListView.cs"> 143 <SubType>Component</SubType> 144 </Compile> 145 <Compile Include="Advanced\MultiSelectListView.Designer.cs"> 146 <DependentUpon>MultiSelectListView.cs</DependentUpon> 141 147 </Compile> 142 148 <Compile Include="Advanced\PluginView.cs">
Note: See TracChangeset
for help on using the changeset viewer.