Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/16/10 18:44:45 (14 years ago)
Author:
gkronber
Message:

Worked on plugin deployment GUI.
Added contact info and license text to DB schema.
#860

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/DeploymentServer Prototype/HeuristicLab.Services/HeuristicLab.DeploymentService.AdminClient/ProductEditor.cs

    r2804 r2816  
    88using System.Windows.Forms;
    99using HeuristicLab.MainForm;
    10 using HeuristicLab.PluginInfrastructure;
    11 using UpdateService = HeuristicLab.PluginInfrastructure.PluginUpdateService;
     10using PluginDeploymentService = HeuristicLab.PluginInfrastructure.Advanced.DeploymentService;
    1211
    1312namespace HeuristicLab.DeploymentService.AdminClient {
     
    1514    private BackgroundWorker refreshProductsWorker;
    1615    private BackgroundWorker uploadChangedProductsWorker;
    17     private List<UpdateService.ProductDescription> products;
    18     private List<UpdateService.PluginDescription> plugins;
    19     private HashSet<UpdateService.ProductDescription> dirtyProducts;
     16    private List<PluginDeploymentService.ProductDescription> products;
     17    private List<PluginDeploymentService.PluginDescription> plugins;
     18    private HashSet<PluginDeploymentService.ProductDescription> dirtyProducts;
    2019
    2120    public ProductEditor() {
     
    2322      Caption = "Products";
    2423
    25       dirtyProducts = new HashSet<UpdateService.ProductDescription>();
     24      dirtyProducts = new HashSet<PluginDeploymentService.ProductDescription>();
    2625      refreshProductsWorker = new BackgroundWorker();
    2726      refreshProductsWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(refreshProductsWorker_RunWorkerCompleted);
     
    3433
    3534    void uploadChangedProductsWorker_DoWork(object sender, DoWorkEventArgs e) {
    36       var products = (IEnumerable<UpdateService.ProductDescription>)e.Argument;
    37       using (var adminClient = new AdminService.AdminClient()) {
     35      var products = (IEnumerable<PluginDeploymentService.ProductDescription>)e.Argument;
     36      using (var adminClient = new PluginDeploymentService.AdminClient()) {
    3837        foreach (var product in products) {
    3938          adminClient.DeployProduct(product);
     
    4847
    4948    void refreshProductsWorker_DoWork(object sender, DoWorkEventArgs e) {
    50       var updateClient = new UpdateService.UpdateClient();
     49      var updateClient = new PluginDeploymentService.UpdateClient();
    5150      e.Result = new object[] { updateClient.GetProducts(), updateClient.GetPlugins() };
    5251    }
    5352
    5453    void refreshProductsWorker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) {
    55       this.products = new List<UpdateService.ProductDescription>(
    56         (UpdateService.ProductDescription[])((object[])e.Result)[0]);
    57       this.plugins = new List<UpdateService.PluginDescription>(
    58         (UpdateService.PluginDescription[])((object[])e.Result)[1]);
     54      this.products = new List<PluginDeploymentService.ProductDescription>(
     55        (PluginDeploymentService.ProductDescription[])((object[])e.Result)[0]);
     56      this.plugins = new List<PluginDeploymentService.PluginDescription>(
     57        (PluginDeploymentService.PluginDescription[])((object[])e.Result)[1]);
    5958
    6059      UpdateProductsList();
     
    7372    private void productsListBox_SelectedIndexChanged(object sender, EventArgs e) {
    7473      if (productsListBox.SelectedItems.Count == 0) return;
    75       UpdateService.ProductDescription activeProduct = (UpdateService.ProductDescription)((ListViewItem)productsListBox.SelectedItem).Tag;
     74      PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)((ListViewItem)productsListBox.SelectedItem).Tag;
    7675      UpdateProductDetails(activeProduct);
    7776    }
    7877
    79     private void UpdateProductDetails(UpdateService.ProductDescription activeProduct) {
     78    private void UpdateProductDetails(PluginDeploymentService.ProductDescription activeProduct) {
    8079      nameTextBox.Text = activeProduct.Name;
    8180      versionTextBox.Text = activeProduct.Version.ToString();
    8281
    8382      pluginsList.Items.Clear();
    84       foreach (UpdateService.PluginDescription pluginDesc in plugins) {
     83      foreach (PluginDeploymentService.PluginDescription pluginDesc in plugins) {
    8584        var matching = from p in activeProduct.Plugins
    8685                       where p.Name == pluginDesc.Name
     
    106105
    107106    private void newProductButton_Click(object sender, EventArgs e) {
    108       var newProduct = new UpdateService.ProductDescription("New product", new Version("0.0.0.0"));
     107      var newProduct = new PluginDeploymentService.ProductDescription("New product", new Version("0.0.0.0"));
    109108      ListViewItem item = CreateListViewItem(newProduct);
    110109      productsListBox.Items.Add(item);
     
    112111    }
    113112
    114     private ListViewItem CreateListViewItem(UpdateService.ProductDescription productDescription) {
     113    private ListViewItem CreateListViewItem(PluginDeploymentService.ProductDescription productDescription) {
    115114      ListViewItem item = new ListViewItem();
    116115      item.Text = productDescription.Name + " " + productDescription.Version;
     
    127126    private void nameTextBox_TextChanged(object sender, EventArgs e) {
    128127      ListViewItem activeItem = (ListViewItem)productsListBox.SelectedItem;
    129       UpdateService.ProductDescription activeProduct = (UpdateService.ProductDescription)activeItem.Tag;
     128      PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)activeItem.Tag;
    130129      if (string.IsNullOrEmpty(nameTextBox.Name)) {
    131130        errorProvider.SetError(nameTextBox, "Invalid value");
     
    140139    private void versionTextBox_TextChanged(object sender, EventArgs e) {
    141140      ListViewItem activeItem = (ListViewItem)productsListBox.SelectedItem;
    142       UpdateService.ProductDescription activeProduct = (UpdateService.ProductDescription)activeItem.Tag;
     141      PluginDeploymentService.ProductDescription activeProduct = (PluginDeploymentService.ProductDescription)activeItem.Tag;
    143142      try {
    144143        activeProduct.Version = new Version(versionTextBox.Text);
Note: See TracChangeset for help on using the changeset viewer.