mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-30 15:06:06 +00:00
MaJ GTK
This commit is contained in:
parent
02062c8b9c
commit
a304207ad5
2 changed files with 5 additions and 28 deletions
|
|
@ -198,6 +198,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Content Include="..\..\Data\library.db">
|
<Content Include="..\..\Data\library.db">
|
||||||
<Link>library.db</Link>
|
<Link>library.db</Link>
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Content>
|
</Content>
|
||||||
<None Include="app.config" />
|
<None Include="app.config" />
|
||||||
<None Include="OpenTK.dll.config" />
|
<None Include="OpenTK.dll.config" />
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
using AideDeJeu.Tools;
|
using AideDeJeu.Tools;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Reflection;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
[assembly: Xamarin.Forms.Dependency(typeof(AideDeJeu.GTK.Version_GTK))]
|
[assembly: Xamarin.Forms.Dependency(typeof(AideDeJeu.GTK.Version_GTK))]
|
||||||
|
|
@ -31,34 +32,9 @@ namespace AideDeJeu.GTK
|
||||||
|
|
||||||
public async Task<string> GetDatabasePathAsync(string databaseName)
|
public async Task<string> GetDatabasePathAsync(string databaseName)
|
||||||
{
|
{
|
||||||
return null;
|
var assembly = typeof(Version_GTK).GetTypeInfo().Assembly;
|
||||||
//var documentsDirectoryPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);
|
var path = AppDomain.CurrentDomain.BaseDirectory; // System.Reflection.Assembly.GetExecutingAssembly().CodeBase;
|
||||||
//var path = Path.Combine(documentsDirectoryPath, databaseName);
|
return Path.Combine(path, $"{databaseName}.db");
|
||||||
|
|
||||||
//// This is where we copy in our pre-created database
|
|
||||||
//if (!File.Exists(path))
|
|
||||||
//{
|
|
||||||
// using (var inStream = Android.App.Application.Context.Assets.Open(databaseName))
|
|
||||||
// {
|
|
||||||
// using (var outStream = new FileStream(path, FileMode.Create))
|
|
||||||
// {
|
|
||||||
// inStream.CopyTo(outStream);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// //using (var binaryReader = new BinaryReader(Android.App.Application.Context.Assets.Open(databaseName)))
|
|
||||||
// //{
|
|
||||||
// // using (var binaryWriter = new BinaryWriter(new FileStream(path, FileMode.Create)))
|
|
||||||
// // {
|
|
||||||
// // byte[] buffer = new byte[2048];
|
|
||||||
// // int length = 0;
|
|
||||||
// // while ((length = binaryReader.Read(buffer, 0, buffer.Length)) > 0)
|
|
||||||
// // {
|
|
||||||
// // binaryWriter.Write(buffer, 0, length);
|
|
||||||
// // }
|
|
||||||
// // }
|
|
||||||
// //}
|
|
||||||
//}
|
|
||||||
//return path;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue