public CloudExplorerViewModel(SelectionUtils selectionUtils) { _selectionUtils = selectionUtils; // Contains the list of sources to display to the user, in the order they will // be displayed. _sources = new List<ICloudExplorerSource> { // The Google App Engine source. new GaeSource(this), // The Google Compute Engine source. new GceSource(this), // The Google Cloud Storage source. new GcsSource(this), // The Google Cloud SQL source. new CloudSQLSource(this), // The source to navigate to the cloud console. new CloudConsoleSource(), }; var refreshButtonEnumerable = new ButtonDefinition[] { new ButtonDefinition { Icon = s_refreshIcon.Value, ToolTip = Resources.CloudExplorerRefreshButtonToolTip, Command = new ProtectedCommand(OnRefreshCommand), } }; Buttons = Enumerable.Concat(refreshButtonEnumerable, _sources.SelectMany(x => x.Buttons)); ManageAccountsCommand = new ProtectedCommand(OnManageAccountsCommand); CredentialsStore.Default.CurrentAccountChanged += OnCurrentAccountChanged; CredentialsStore.Default.CurrentProjectIdChanged += OnCurrentProjectIdChanged; CredentialsStore.Default.Reset += OnReset; ResetCredentials(); }
/// <summary> /// Initializes a new instance of the <see cref="CloudExplorerToolWindowControl"/> class. /// </summary> public CloudExplorerToolWindowControl(SelectionUtils selectionUtils) { this.InitializeComponent(); _selectionUtils = selectionUtils; }