Esempio n. 1
0
        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;
                }
            }
        }