/// <summary> /// Handle deploy from main explorer /// </summary> /// <param name="message"></param> public void Handle(SelectItemInDeployMessage message) { Dev2Logger.Log.Info(message.GetType().Name); _initialItemResourceID = message.ResourceID; _initialItemEnvironmentID = message.EnvironmentID; SourceConnectControlViewModel.SetTargetEnvironment(); SelectSourceServerFromInitialValue(); var root = Source.ExplorerItemModels.FirstOrDefault(); if (root != null) { var resourceTreeViewModels = root.Descendants().First(a => a.ResourceId == message.ResourceID); if (resourceTreeViewModels != null) { resourceTreeViewModels.IsChecked = true; } } }
/// <summary> /// Selects the server from initial value. /// </summary> private void SelectSourceServerFromInitialValue() { IEnvironmentModel environment = null; if (_initialItemResourceID != Guid.Empty) { environment = EnvironmentRepository.FindSingle(model => model.ID == _initialItemEnvironmentID); } if (environment != null) { var server = Servers.FirstOrDefault(s => ServerEqualityComparer.Current.Equals(s, environment)); // // Setting the SelectedSourceServer will run the LoadSourceEnvironment method, // which takes care of selecting and expanding the correct node // if (SourceConnectControlViewModel != null) { SourceConnectControlViewModel.UpdateActiveEnvironment(environment, false); SourceConnectControlViewModel.SetTargetEnvironment(); } SelectedSourceServer = server; } }