Exemple #1
0
        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;
                }
            }
        }
Exemple #2
0
        private async void SetMonacoTheme()
        {
            if (EditorIsLoaded)
            {
                var MonacoTheme = ModulesAccessManager.GetModuleViaID(ModulesAccessManager.GetCurrentThemeMonacoID());
                ContentViewer.SendAndExecuteJavaScript(await new ThemeReader(ModulesAccessManager.GetCurrentThemeMonacoID()).GetThemeJSContentAsync());
                ContentViewer.SendAndExecuteJavaScript("monaco.editor.setTheme('" + MonacoTheme.ModuleMonacoThemeName + "');");

                //Debug.WriteLine(MonacoTheme.ModuleMonacoThemeName);
            }
        }
Exemple #3
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;
                }
            }
        }