public Space GetSpaceById(string spaceId) { var space = Spaces.FirstOrDefault(s => s.id == spaceId); if (space == null) { space = Spaces.Flatten <Space>(s => s.childSpaces).FirstOrDefault(s => s.id == spaceId); } return(space); }
public ConfluenceSearch(ConfluenceUpload confluenceUpload) { _confluenceUpload = confluenceUpload; DataContext = this; InitializeComponent(); if (ConfluenceConfig.SearchSpaceKey == null) { SpaceComboBox.SelectedItem = Spaces.FirstOrDefault(); } else { foreach (var space in Spaces) { if (space.Key.Equals(ConfluenceConfig.SearchSpaceKey)) { SpaceComboBox.SelectedItem = space; } } } }