private void LoadStory(Stream s) { var reader = new StoryReader(); _story = reader.Read(s); databaseSelectorCb.Items.Clear(); foreach (KeyValuePair <uint, Database> database in _story.Databases) { var name = "(Unnamed)"; Node owner = database.Value.OwnerNode; if (owner != null) { name = owner.Name.Length > 0 ? $"{owner.Name}({owner.NumParams})" : $"<{owner.TypeName()}>"; } name += $" #{database.Key} ({database.Value.Facts.Count} rows)"; databaseSelectorCb.Items.Add(name); if (databaseSelectorCb.Items.Count > 0) { databaseSelectorCb.SelectedIndex = 0; } } }