Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/22/12 16:08:20 (12 years ago)
Author:
spimming
Message:

#1680:

  • User setting to store azure subscriptions
  • Method to get subscription as string for user settings
  • Methods to persist and restore subscriptions from user config
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Hive.Azure/HeuristicLab.Clients.Hive.CloudManager/3.3/CloudManagerClient.cs

    r7577 r7655  
    2222using System;
    2323using System.Collections.Generic;
     24using System.Collections.Specialized;
    2425using HeuristicLab.Clients.Hive.CloudManager.Azure;
    2526using HeuristicLab.Clients.Hive.CloudManager.Model;
     27using HeuristicLab.Clients.Hive.CloudManager.Properties;
    2628using HeuristicLab.Common;
    2729using HeuristicLab.Core;
     
    211213    }
    212214
    213 
     215    public void PersistSubscriptionsToUserConfig() {
     216      StringCollection strCol = new StringCollection();
     217      foreach (Subscription sub in Subscriptions) {
     218        if (sub.SaveToConfig) {
     219          string setting = sub.GetSettingString();
     220          Settings.Default.AzureSubscriptions.Add(setting);
     221        }
     222      }
     223      //TODO:
     224      //Settings.Default.Upgrade();
     225      //Settings.Default.Save();
     226
     227    }
     228
     229    public void RestoreSubscriptionsFromUserConfig() {
     230      StringCollection strCol = new StringCollection();
     231      foreach (string azureSub in strCol) {
     232        Subscription s = Subscription.ParseSettingString(azureSub);
     233        s.SaveToConfig = true;
     234        Add(s);
     235      }
     236    }
    214237  }
    215238}
Note: See TracChangeset for help on using the changeset viewer.