mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	Ouvrir avec
This commit is contained in:
		
							parent
							
								
									2afdc1e6b6
								
							
						
					
					
						commit
						999a6d4f87
					
				
					 2 changed files with 13 additions and 5 deletions
				
			
		|  | @ -1224,8 +1224,8 @@ namespace AideDeJeu.ViewModels.PlayerCharacter | |||
| 
 | ||||
|         public async Task ExecuteGenerateAndOpenPdfCommandAsync() | ||||
|         { | ||||
|             await GeneratePdfAsync(SelectedPlayerCharacter); | ||||
|             await OpenPdfAsync(); | ||||
|             var filename = await GeneratePdfAsync(SelectedPlayerCharacter); | ||||
|             await OpenPdfAsync(filename); | ||||
|         } | ||||
| 
 | ||||
|         public string BasePdfDirectory | ||||
|  | @ -1305,10 +1305,10 @@ namespace AideDeJeu.ViewModels.PlayerCharacter | |||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         async Task OpenPdfAsync() | ||||
|         public async Task OpenPdfAsync(string filename) | ||||
|         { | ||||
|             var testfile = Path.Combine(Xamarin.Essentials.FileSystem.CacheDirectory, "test.pdf"); | ||||
|             await DependencyService.Get<INativeAPI>().LaunchFileAsync("hophop", "coucou", testfile); | ||||
|             var filepath = Path.Combine(BasePdfDirectory, filename); | ||||
|             await DependencyService.Get<INativeAPI>().LaunchFileAsync("hophop", "coucou", filepath); | ||||
|         } | ||||
| 
 | ||||
|         private int PickAbility(ref List<int> mins, ref List<int> maxs, string name) | ||||
|  |  | |||
|  | @ -2,7 +2,9 @@ | |||
| using AideDeJeu.ViewModels.PlayerCharacter; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.IO; | ||||
| using System.Linq; | ||||
| using System.Net; | ||||
| using System.Text; | ||||
| using System.Threading.Tasks; | ||||
| using System.Windows.Input; | ||||
|  | @ -45,6 +47,12 @@ namespace AideDeJeu.Views.PlayerCharacter | |||
|         private async Task ExecuteShareCommandAsync() | ||||
|         { | ||||
|             var result = await DisplayActionSheet("Actions", "Annuler", null, "Envoyer vers...", "Ouvrir avec..."); | ||||
|             if(result == "Ouvrir avec...") | ||||
|             { | ||||
|                 string filePath = Path.Combine(Xamarin.Essentials.FileSystem.CacheDirectory, Path.Combine("pdf", WebUtility.UrlEncode(PdfFile.Result))); | ||||
|                 await DependencyService.Get<PlayerCharacterEditorViewModel>().OpenPdfAsync(filePath); | ||||
| 
 | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez