public async Task Open(MouseEventArgs e, ClientPlanetCategory category)
        {
            Component.SetPosition(e.ClientX, e.ClientY);
            Component.SetVisibility(true);
            SelectedCategory = category;

            if (OpenEvent != null)
            {
                await OpenEvent.Invoke();
            }
        }
Beispiel #2
0
        public async Task NotifyUpdateCategory(ClientPlanetCategory category)
        {
            if (_category_ids == null)
            {
                await LoadCategoriesAsync();
            }

            // Set in cache
            ClientCache.Categories[category.Id] = category;

            // Reo-order categories
            List <ClientPlanetCategory> categories = new();

            foreach (var id in _category_ids)
            {
                categories.Add(ClientCache.Categories[id]);
            }

            _category_ids = categories.OrderBy(x => x.Position).Select(x => x.Id).ToList();
        }
Beispiel #3
0
        public void NotifyDeleteCategory(ClientPlanetCategory category)
        {
            _category_ids.Remove(category.Id);

            ClientCache.Categories.Remove(category.Id, out _);
        }