#At file:///C:/Users/Reggie/work/wex/installer-updated/ based on revid:reggie.burnett@strippedlnmrg4mt422mh6
278 Reggie Burnett 2011-02-01
checking in a couple of missing files
added:
ManifestManager/ListEditor.cs
WexInstallerUpdater/ProductManifest.cs
=== added file 'ManifestManager/ListEditor.cs'
=== added file 'ManifestManager/ListEditor.cs'
--- a/ManifestManager/ListEditor.cs 1970-01-01 00:00:00 +0000
+++ b/ManifestManager/ListEditor.cs 2011-02-01 15:53:44 +0000
@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Drawing.Design;
+using System.ComponentModel;
+using System.Windows.Forms;
+using System.Windows.Forms.Design;
+using WexInstaller.Core;
+
+namespace ManifestManager
+{
+ public abstract class ListEditor : UITypeEditor
+ {
+ private IWindowsFormsEditorService editorService;
+
+ public override UITypeEditorEditStyle GetEditStyle(ITypeDescriptorContext context)
+ {
+ return UITypeEditorEditStyle.DropDown;
+ }
+
+ public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
+ {
+ if (provider != null)
+ {
+ editorService = provider.GetService(typeof(IWindowsFormsEditorService))
+ as IWindowsFormsEditorService;
+ }
+
+ if (editorService != null)
+ {
+ ListBox list = new ListBox();
+ list.Click += new EventHandler(list_Click);
+ FillList(context.Instance, list);
+ editorService.DropDownControl(list);
+ value = list.SelectedItem;
+ }
+ return value;
+ }
+
+ protected virtual void FillList(object instance, ListBox listbox)
+ {
+ }
+
+ void list_Click(object sender, EventArgs e)
+ {
+ if (editorService != null)
+ editorService.CloseDropDown();
+ }
+ }
+
+ public class CatalogProductList : ListEditor
+ {
+ protected override void FillList(object instance, ListBox listbox)
+ {
+ CatalogProduct catalogProduct = instance as CatalogProduct;
+ ProductCatalog catalog = catalogProduct.Catalog;
+
+ // now we want to add in all products in all categories that are not already
+ // attached to this catalog
+ foreach (ProductCategory category in ProductManifest.Instance.ProductCategories)
+ foreach (Product product in category.Products)
+ {
+ if (product != catalogProduct.ReferencedProduct && catalog.Includes(product)) continue;
+ listbox.Items.Add(product);
+ }
+ }
+ }
+}
=== added file 'WexInstallerUpdater/ProductManifest.cs'
--- a/WexInstallerUpdater/ProductManifest.cs 1970-01-01 00:00:00 +0000
+++ b/WexInstallerUpdater/ProductManifest.cs 2011-02-01 15:53:44 +0000
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Xml.Serialization;
+using System.IO;
+
+namespace WexInstaller.Core
+{
+ public sealed class ProductManifest
+ {
+ [XmlAttribute("version")]
+ public int Version { get; set; }
+
+ [XmlAttribute("format")]
+ public int Format { get; set; }
+
+ [XmlElement("UpdateVersion")]
+ public string UpdateVersion { get; set; }
+
+ [XmlElement("UpdateURL")]
+ public string UpdateUrl { get; set; }
+
+ [XmlElement("UpdateHash")]
+ public string UpdateHash { get; set; }
+ }
+}
Attachment: [text/bzr-bundle] bzr/reggie.burnett@oracle.com-20110201155344-s6r07tq9i9fjtd92.bundle
| Thread |
|---|
| • bzr commit into wex-installer-1.0 branch (reggie.burnett:278) | Reggie Burnett | 1 Feb |