private void UpdateAvailableObjects() { switch (PatchOn) { case PatchOnOptions.Collection: ApplicationModel.Current.Server.Value.SelectedDatabase.Value.AsyncDatabaseCommands.GetTermsCount( CollectionsIndex, "Tag", "", 100) .ContinueOnSuccessInTheUIThread(collections => { AvailableObjects.Clear(); AvailableObjects.AddRange(collections.OrderByDescending(x => x.Count) .Where(x => x.Count > 0) .Select(col => col.Name).ToList()); SelectedItem = AvailableObjects.FirstOrDefault(); }); break; case PatchOnOptions.Index: ApplicationModel.Database.Value.AsyncDatabaseCommands.GetIndexNamesAsync(0, 500) .ContinueOnSuccessInTheUIThread(indexes => { AvailableObjects.Clear(); AvailableObjects.AddRange(indexes.OrderBy(x => x)); SelectedItem = AvailableObjects.FirstOrDefault(); }); break; } }
public void UpdateSelectionWindow(TileObject tileObject) { GameObject gameObject = AvailableObjects.FirstOrDefault(a => a.TileObject == tileObject); _selectionWindowCreator.UpdateSelectionWindow(SelectionGrid, gameObject); }