private async void ListModules_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (ListModules.SelectedItem != null) { var module = (ModuleInfosShow)ListModules.SelectedItem; switch (currentSelectedButton) { case 0: await Task.Run(() => { new AddonExecutor(module.Module.ID, new SCEELibs.SCEELibs(module.Module.ID)).ExecuteDefaultFunction(AddonExecutorFuncTypes.main); }); break; case 1: await ModulesWriteManager.SetCurrentThemeIDAsync(module.Module.ID, false); if (module.Module.ContainMonacoTheme) { await ModulesWriteManager.SetCurrentMonacoThemeIDAsync(module.Module.ID, false); } Messenger.Default.Send(new SMSNotification { Type = TypeUpdateModule.CurrentThemeUpdated, ID = module.Module.ID }); LoadModules(); break; } } }
private async void InstallModuleButton_Click(object sender, RoutedEventArgs e) { if (ModuleFile != null) { PackageVerificationCode CodeResult = await VerifyAssistant.VerifyPackageAsync(); if (CodeResult == PackageVerificationCode.Passed) { if (await ModulesWriteManager.AddModuleAsync(ModuleFile)) { ResultText.Text = "Module has been installed without any problem !"; } else { ResultText.Text = "Module was not installed :("; } } else { ResultText.Text = "Error with the module: " + CodeResult.ToString(); } VerifyModuleGrid.Visibility = Visibility.Collapsed; ResultInstallation.Visibility = Visibility.Visible; } }
public async void deleteModule(string ID) { await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { var infos = getModuleInfosViaID(ID); MessageDialog dialog_warning = new MessageDialog(""); dialog_warning.Title = "An module want to uninstall \"" + infos.moduleName + "\" on the editor"; dialog_warning.Content = "Are you sure to accept the module to uninstall \"" + infos.moduleName + "\" on the editor ?"; dialog_warning.Commands.Add(new UICommand { Label = "Yes", Invoked = async(e) => { await ModulesWriteManager.DeleteModuleViaIDAsync(ID); } }); dialog_warning.Commands.Add(new UICommand { Label = "No", Invoked = (e) => { } }); await dialog_warning.ShowAsync(); }); }
public async void installModule(string zip_path) { await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { MessageDialog dialog_warning = new MessageDialog(""); dialog_warning.Title = "An module want to install a new module on the editor"; dialog_warning.Content = "Are you sure to accept the module to install a new module on the editor ?"; dialog_warning.Commands.Add(new UICommand { Label = "Yes", Invoked = async(e) => { StorageFile file = await StorageFile.GetFileFromPathAsync(zip_path); var result_verify = await new ModulesVerifyAssistant(file).VerifyPackageAsync(); if (result_verify == PackageVerificationCode.Passed) { await ModulesWriteManager.AddModuleAsync(file); } } }); dialog_warning.Commands.Add(new UICommand { Label = "No", Invoked = (e) => {} }); await dialog_warning.ShowAsync(); }); }
public async void setMonacoEditorTheme(int ID) { await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { await ModulesWriteManager.SetCurrentMonacoThemeIDAsync(ID, true); }); }
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 ListModules_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (ListModules.SelectedItem != null) { var module = (ModuleInfosShow)ListModules.SelectedItem; switch (currentSelectedButton) { case 0: await Task.Run(() => { new AddonExecutor(module.Module.ID, new SCEELibs.SCEELibs(module.Module.ID)).ExecuteDefaultFunction(AddonExecutorFuncTypes.main); }); break; case 1: await ModulesWriteManager.SetCurrentThemeIDAsync(module.Module.ID); break; } } }