Deserialisation :s

master
Baptiste ARNAUD 5 years ago
parent 9a0d745e6f
commit f0d8982976

Binary file not shown.

@ -3,4 +3,6 @@
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<application android:label="TheGameExtreme.Android" android:icon="@drawable/Apple"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
</manifest>

@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
namespace TheGameExtreme.IO
{
class IOOptions
{
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "file.xml");
public void SaveOptionParameter()
{
/*if (!File.Exists(path))
{
XmlSerializer ser = new XmlSerializer(typeof(bool));
using (StreamWriter sw = File.CreateText(path))
{
sw.WriteLine(swTheme.IsToggled);
}
}*/
}
}
}

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="TheGameExtreme.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary>
<Color x:Key="BlackColor">black</Color>
<Color x:Key="WhiteColor">white</Color>
<Color x:Key="SkyBlueColor">SkyBlue</Color>
<Color x:Key="BlackColor">black</Color>
<Color x:Key="WhiteColor">white</Color>
<Color x:Key="SkyBlueColor">SkyBlue</Color>
</ResourceDictionary>
</Application.Resources>
</Application>

@ -1,7 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using Xamarin.Forms;
using System.Diagnostics;
namespace TheGameExtreme.view
{
@ -12,6 +14,12 @@ namespace TheGameExtreme.view
{
InitializeComponent();
NavigationPage.SetHasNavigationBar(this, false);
/*string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "file.xml");
XmlSerializer xs = new XmlSerializer(typeof(bool));
FileStream fs = new FileStream(path, FileMode.Open);
bool test = (bool)xs.Deserialize(fs);
Debug.WriteLine(test);*/
}
private async void OpenGame(object sender, EventArgs args)
{

@ -1,6 +1,9 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
@ -44,9 +47,6 @@ namespace TheGameExtreme.view
}
}
private void CBFr_CheckedChanged(object sender, CheckedChangedEventArgs e)
@ -70,7 +70,6 @@ namespace TheGameExtreme.view
Application.Current.Resources["BlackColor"] = Color.Black;
Application.Current.Resources["WhiteColor"] = Color.White;
Application.Current.Resources["SkyBlueColor"] = Color.SkyBlue;
}
else
{
@ -80,16 +79,27 @@ namespace TheGameExtreme.view
}
}
private async void SettingToHomePage(object sender, EventArgs e)
{
string path = @"\Documents\theme.txt";
FileStream fs = File.Create(path);
byte[] info = new UTF8Encoding(true).GetBytes(bSwitchSerialisation.ToString());
fs.Write(info, 0, info.Length);
//serialisationSwitch();
await Navigation.PopAsync();
}
/*public void serialisationSwitch()
{
string path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "file.xml");
if (!File.Exists(path))
{
XmlSerializer ser = new XmlSerializer(typeof(bool));
using (StreamWriter sw = File.CreateText(path))
{
sw.WriteLine(swTheme.IsToggled);
}
}
}*/
}
}

Loading…
Cancel
Save