private async void LoadModules() { ListModules.Items.Clear(); int IDThemeMonaco = await ModulesAccessManager.GetCurrentThemeMonacoID(), IDTheme = await ModulesAccessManager.GetCurrentThemeIDAsync(); foreach (InfosModule module in await ModulesAccessManager.GetModulesAsync(true)) { var module_infos = new ModuleInfosShow { Module = module, StrokeThickness = 0 }; var reader = new AddonReader(module_infos.Module.ID); module_infos.Thumbnail = await reader.GetAddonIconViaIDAsync(); switch (module.ModuleType) { case ModuleTypesList.Addon when currentSelectedButton == 0: ListModules.Items.Add(module_infos); break; case ModuleTypesList.Theme when currentSelectedButton == 1: if (IDTheme == module_infos.Module.ID || IDThemeMonaco == module_infos.Module.ID) { module_infos.StrokeThickness = 2; } ListModules.Items.Add(module_infos); break; } } }
private async void DeleteAcceptButton_Click(object sender, RoutedEventArgs e) { ModuleInfosShow element = (ModuleInfosShow)((Button)sender).DataContext; if (await ModulesWriteManager.DeleteModuleViaIDAsync(element.Module.ID)) { LoadModules(); } }
private async void ModulePin_Click(object sender, RoutedEventArgs e) { ModuleInfosShow module = (ModuleInfosShow)(sender as Button).DataContext; List <int> list = await ModulesPinned.GetModulesPinned(); if (list.Contains(module.Module.ID)) { ModulesPinned.RemoveModule(module.Module.ID); } else { ModulesPinned.AddNewModule(module.Module.ID); } }
private async void LoadModules() { ListModules.Items.Clear(); int IDThemeMonaco = ModulesAccessManager.GetCurrentThemeMonacoID(), IDTheme = ModulesAccessManager.GetCurrentThemeID(); switch (currentSelectedButton) { default: ListModules.SelectionMode = ListViewSelectionMode.Single; break; case 2: case 3: ListModules.SelectionMode = ListViewSelectionMode.None; break; } foreach (InfosModule module in ModulesAccessManager.GetModules(true)) { ModuleInfosShow ModuleInfos = new ModuleInfosShow { Module = module, StrokeThickness = 0 }; ModuleInfos.Thumbnail = await ModulesAccessManager.GetModuleDefaultLogoViaIDAsync(ModuleInfos.Module.ID, ModuleInfos.Module.ModuleSystem); switch (module.ModuleType) { case ModuleTypesList.Templates when currentSelectedButton == 3: case ModuleTypesList.ProgrammingLanguage when currentSelectedButton == 2: case ModuleTypesList.Addon when currentSelectedButton == 0: ListModules.Items.Add(ModuleInfos); break; case ModuleTypesList.Theme when currentSelectedButton == 1: if (IDTheme == ModuleInfos.Module.ID || IDThemeMonaco == ModuleInfos.Module.ID) { ModuleInfos.StrokeThickness = 2; } ListModules.Items.Add(ModuleInfos); break; } } }
private async void LoadModules() { ListModules.Items.Clear(); foreach (InfosModule module in await ModulesAccessManager.GetModulesAsync(true)) { var module_infos = new ModuleInfosShow { Module = module }; var reader = new AddonReader(module_infos.Module.ID); module_infos.Thumbnail = await reader.GetAddonIconViaIDAsync(); switch (module.ModuleType) { case ModuleTypesList.Addon when currentSelectedButton == 0: ListModules.Items.Add(module_infos); break; case ModuleTypesList.Theme when currentSelectedButton == 1: ListModules.Items.Add(module_infos); break; } } }