diff --git a/BuildPortable.bat b/BuildPortable.bat
new file mode 100644
index 00000000..284e7c78
--- /dev/null
+++ b/BuildPortable.bat
@@ -0,0 +1 @@
+cd InternetTest\InternetTest && dotnet publish -r win-x64 -c Release --self-contained false -p:DefineConstants=PORTABLE
diff --git a/InternetTest/InternetTest/App.xaml b/InternetTest/InternetTest/App.xaml
index 185f26e5..a766fcf8 100644
--- a/InternetTest/InternetTest/App.xaml
+++ b/InternetTest/InternetTest/App.xaml
@@ -33,24 +33,24 @@
-
+
-
+
-
+
-
+
@@ -82,20 +82,20 @@
-
+
-
+
-
+
@@ -127,7 +127,7 @@
-
+
@@ -140,7 +140,61 @@
-
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
@@ -1047,7 +1145,7 @@
Color="Transparent">
@@ -1134,7 +1232,7 @@
Color="Transparent">
@@ -1210,7 +1308,7 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Text="{x:Static lang:Resources.QuickActions}" />
+ Grid.Row="5"
+ Orientation="Horizontal">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/InternetTest/InternetTest/Pages/HomePage.xaml.cs b/InternetTest/InternetTest/Pages/HomePage.xaml.cs
index a29f4145..d3b02e5c 100644
--- a/InternetTest/InternetTest/Pages/HomePage.xaml.cs
+++ b/InternetTest/InternetTest/Pages/HomePage.xaml.cs
@@ -24,11 +24,19 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using InternetTest.Classes;
using InternetTest.Enums;
using InternetTest.UserControls;
+using ManagedNativeWifi;
using PeyrSharp.Core;
+using PeyrSharp.Env;
+using System;
using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
using System.Linq;
+using System.Net.Http;
+using System.Threading.Tasks;
+using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
+using System.Xml.Serialization;
namespace InternetTest.Pages;
///
@@ -46,16 +54,13 @@ internal async void InitUI()
{
// Load "Get started" section
List relevantPages = Enumerable.Empty().ToList();
- List relevantActions = Enumerable.Empty().ToList();
if (Global.SynethiaConfig is not null)
{
relevantPages = Global.GetMostRelevantPages(Global.SynethiaConfig);
- Global.GetMostRelevantActions(Global.SynethiaConfig).ForEach((ActionInfo actionInfo) => relevantActions.Add(actionInfo.Action));
}
else
{
relevantPages = Global.DefaultRelevantPages;
- Global.DefaultRelevantActions.ForEach((ActionInfo actionInfo) => relevantActions.Add(actionInfo.Action));
}
for (int i = 0; i < 5; i++)
@@ -70,16 +75,230 @@ internal async void InitUI()
DiscoverPanel.Children.Add(new PageCard(relevantPages[i]));
}
- // Load "Suggested actions" section
- for (int i = 0; i < 4; i++)
+ // Load "Status" section
+ if (Global.Settings.TestOnStart) LoadStatusCard();
+
+ // Load "Network" section
+ LoadNetworkCard();
+
+ // Load "My IP" section
+ ip = (await Global.GetIPInfoAsync("")).Query ?? "";
+ }
+
+ private async void RefreshStatusBtn_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+ StatusTxt.Text = Properties.Resources.Checking;
+ LoadStatusCard();
+ }
+
+ bool connected = true;
+ internal async void LoadStatusCard()
+ {
+ connected = await Internet.IsAvailableAsync(Global.Settings.TestSite); // Check if Internet is available
+ StatusTxt.Text = connected ? Properties.Resources.ConnectedS : Properties.Resources.NotConnectedS; // Set text
+ StatusIconTxt.Text = connected ? "\uF299" : "\uF36E";
+ StatusIconTxt.Foreground = connected ? Global.GetBrushFromResource("Green") : Global.GetBrushFromResource("Red");
+ }
+
+ internal void LoadNetworkCard()
+ {
+ try
+ {
+ string ssid = Global.GetCurrentWifiSSID();
+
+ NetworkTxt.Text = (ssid == null || !connected) ? Properties.Resources.NotConnectedS : ssid;
+ NetworkIconTxt.Text = (ssid == null || !connected) ? "\uFB71" : "\uF8C5";
+
+ }
+ catch // If there is no WiFi
{
- SuggestedActionsPanel.Children.Add(new ActionCard(relevantActions[i]));
+ NetworkIconTxt.Text = connected ? "\uF35A" : "\uFC27";
+ NetworkTxt.Text = connected ? Properties.Resources.Ethernet : Properties.Resources.NotConnectedS;
}
+ }
- // Load "Status" section
- bool connected = await Internet.IsAvailableAsync(Global.Settings.TestSite); // Check if Internet is available
- StatusTxt.Text = connected ? Properties.Resources.Connected : Properties.Resources.NotConnected; // Set text
- StatusIconTxt.Text = connected ? "\uF299" : "\uF36E";
- StatusIconTxt.Foreground = connected ? new SolidColorBrush(Global.GetColorFromResource("Green")) : new SolidColorBrush(Global.GetColorFromResource("Red"));
+ private void RefreshNetworkBtn_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+ LoadNetworkCard();
+ }
+
+ string ip = "";
+ private async void RefreshMyIpBtn_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+ ip = (await Global.GetIPInfoAsync("")).Query ?? "";
+ }
+
+ private void MyIpBorder_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
+ {
+ MyIpTxt.Text = ip;
+ RefreshMyIpBtn.Visibility = Visibility.Visible;
+ }
+
+ private void MyIpBorder_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
+ {
+ MyIpTxt.Text = Properties.Resources.HoverToReveal;
+ RefreshMyIpBtn.Visibility = Visibility.Hidden;
+ }
+
+ private async void SpeedTest_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+ SpeedTestPopup.IsOpen = true;
+ ConnectPopup.IsOpen = false;
+ PasswordPopup.IsOpen = false;
+ try
+ {
+ CloseSpeedTestBtn.IsEnabled = false;
+ SpeedTestStatus.Text = Properties.Resources.TestInProgress;
+
+ // Test
+ string targetUrl = "http://speedtest.tele2.net/10MB.zip";
+ SpeedTxt.Text = "...";
+ long fileSize = await DownloadFile(targetUrl);
+ double speedMbps = fileSize / 1000000.0;
+
+ SpeedTxt.Text = $"{speedMbps:0.00} MB/s";
+ SpeedTestStatus.Text = Properties.Resources.SpeedTestSucess;
+ }
+ catch
+ {
+ SpeedTestStatus.Text = Properties.Resources.SpeedTestFailed;
+ }
+ CloseSpeedTestBtn.IsEnabled = true;
+ }
+
+ private void CloseSpeedTestBtn_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+ SpeedTestPopup.IsOpen = false;
+ }
+
+ static async Task DownloadFile(string url)
+ {
+ Stopwatch stopwatch = Stopwatch.StartNew();
+
+ using (HttpClient client = new HttpClient())
+ {
+ HttpResponseMessage response = await client.GetAsync(url);
+
+ if (response.IsSuccessStatusCode)
+ {
+ byte[] data = await response.Content.ReadAsByteArrayAsync();
+ stopwatch.Stop();
+ return data.Length;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+ }
+
+ private async void ConnectWiFi_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+ try
+ {
+ ConnectPopup.IsOpen = true;
+ SpeedTestPopup.IsOpen = false;
+ PasswordPopup.IsOpen = false;
+ WiFiDisplayer.Children.Clear();
+ await NativeWifi.ScanNetworksAsync(TimeSpan.FromSeconds(10));
+ var wifis = Global.GetWiFis();
+ for (int i = 0; i < wifis.Count; i++)
+ {
+ WiFiDisplayer.Children.Add(new WiFiNetworkItem(wifis[i]));
+ }
+ }
+ catch
+ {
+
+ }
+ }
+
+ private void CloseConnectBtn_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+ ConnectPopup.IsOpen = false;
+ }
+
+ private async void RecoverWiFi_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
+ {
+ PasswordPopup.IsOpen = true;
+ SpeedTestPopup.IsOpen = false;
+ ConnectPopup.IsOpen = false;
+ await GetWiFiNetworksInfo();
+ }
+
+ private void ClosePasswordBtn_Click(object sender, System.Windows.RoutedEventArgs e)
+ {
+ PasswordPopup.IsOpen = false;
+ }
+
+ async Task GetWiFiNetworksInfo()
+ {
+
+ try
+ {
+ WiFiItemDisplayer.Children.Clear(); // Clear the panel
+
+ // Check if the temp directory exists
+ string path = FileSys.AppDataPath + @"\Léo Corporation\InternetTest Pro\Temp";
+
+ if (!Directory.Exists(path))
+ {
+ Directory.CreateDirectory(path);
+ };
+
+ // Run "netsh wlan export profile key=clear" command
+ Process process = new();
+ process.StartInfo.FileName = "cmd.exe";
+ process.StartInfo.Arguments = $"/c netsh wlan export profile key=clear folder=\"{path}\"";
+ process.StartInfo.UseShellExecute = false;
+ process.StartInfo.CreateNoWindow = true;
+ process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
+ process.Start();
+ await process.WaitForExitAsync();
+
+ // Read the files
+ string[] files = Directory.GetFiles(path);
+ for (int i = 0; i < files.Length; i++)
+ {
+ XmlSerializer serializer = new(typeof(WLANProfile));
+ StreamReader streamReader = new(files[i]); // Where the file is going to be read
+
+ var test = (WLANProfile?)serializer.Deserialize(streamReader);
+
+ if (test != null)
+ {
+ WiFiItemDisplayer.Children.Add(new WiFiInfoItem(test));
+ }
+ streamReader.Close();
+
+ File.Delete(files[i]); // Remove the temp file
+
+ }
+ Directory.Delete(path); // Delete the temp directory
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
+
+ private void StatusBorder_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
+ {
+ RefreshStatusBtn.Visibility = Visibility.Visible;
+ }
+
+ private void StatusBorder_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
+ {
+ RefreshStatusBtn.Visibility = Visibility.Hidden;
+ }
+
+ private void NetworkBorder_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
+ {
+ RefreshNetworkBtn.Visibility = Visibility.Visible;
+ }
+
+ private void NetworkBorder_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
+ {
+ RefreshNetworkBtn.Visibility = Visibility.Hidden;
}
}
diff --git a/InternetTest/InternetTest/Pages/IpConfigPage.xaml b/InternetTest/InternetTest/Pages/IpConfigPage.xaml
index ca20bfa2..b104d760 100644
--- a/InternetTest/InternetTest/Pages/IpConfigPage.xaml
+++ b/InternetTest/InternetTest/Pages/IpConfigPage.xaml
@@ -12,7 +12,7 @@
d:DesignWidth="800"
Background="Transparent"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
@@ -27,7 +27,7 @@
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="16"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Text="" />
(this))
- {
- b.Click += (sender, e) =>
- {
- Global.SynethiaConfig.IPConfigPageInfo.InteractionCount++;
- };
- }
-
- // For each TextBox of the page
- foreach (TextBox textBox in Global.FindVisualChildren(this))
- {
- textBox.GotFocus += (o, e) =>
- {
- Global.SynethiaConfig.IPConfigPageInfo.InteractionCount++;
- };
- }
-
- // For each CheckBox/RadioButton of the page
- foreach (CheckBox checkBox in Global.FindVisualChildren(this))
- {
- checkBox.Checked += (o, e) =>
- {
- Global.SynethiaConfig.IPConfigPageInfo.InteractionCount++;
- };
- checkBox.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.IPConfigPageInfo.InteractionCount++;
- };
- }
-
- foreach (RadioButton radioButton in Global.FindVisualChildren(this))
- {
- radioButton.Checked += (o, e) =>
- {
- Global.SynethiaConfig.IPConfigPageInfo.InteractionCount++;
- };
- radioButton.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.IPConfigPageInfo.InteractionCount++;
- };
- }
+ Loaded += (o, e) => SynethiaManager.InjectSynethiaCode(this, Global.SynethiaConfig.PagesInfo, 4, ref codeInjected);
}
private void InitUI()
@@ -134,6 +88,6 @@ internal void RefreshBtn_Click(object sender, RoutedEventArgs e)
InitUI(); // Refresh the UI
// Increment the interaction count of the ActionInfo in Global.SynethiaConfig
- Global.SynethiaConfig.ActionInfos.First(a => a.Action == Enums.AppActions.GetIPConfig).UsageCount++;
+ Global.SynethiaConfig.ActionsInfo.First(a => a.Name == "IPConfig.Get").UsageCount++;
}
}
diff --git a/InternetTest/InternetTest/Pages/LocateIpPage.xaml b/InternetTest/InternetTest/Pages/LocateIpPage.xaml
index 8c40f27b..d426d604 100644
--- a/InternetTest/InternetTest/Pages/LocateIpPage.xaml
+++ b/InternetTest/InternetTest/Pages/LocateIpPage.xaml
@@ -12,7 +12,7 @@
d:DesignWidth="800"
Background="Transparent"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
@@ -28,7 +28,7 @@
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="16"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Text="" />
+ Color="{DynamicResource AccentColor}" />
+ Foreground="{DynamicResource DarkGray}" />
@@ -140,7 +139,7 @@
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="16"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Text="" />
+
+ Color="{DynamicResource AccentColor}" />
@@ -180,7 +192,7 @@
+ Color="{DynamicResource AccentColor}" />
@@ -225,7 +237,7 @@
+ Color="{DynamicResource AccentColor}" />
@@ -270,7 +282,7 @@
+ Color="{DynamicResource AccentColor}" />
@@ -314,7 +326,7 @@
+ Color="{DynamicResource AccentColor}" />
@@ -359,7 +371,7 @@
+ Color="{DynamicResource AccentColor}" />
@@ -404,7 +416,7 @@
+ Color="{DynamicResource AccentColor}" />
@@ -449,7 +461,7 @@
+ Color="{DynamicResource AccentColor}" />
@@ -493,7 +505,7 @@
@@ -45,7 +45,7 @@ public LocateIpPage()
{
InitializeComponent();
InitUI(); // Load the UI
- InjectSynethiaCode();
+ Loaded += (o, e) => SynethiaManager.InjectSynethiaCode(this, Global.SynethiaConfig.PagesInfo, 3, ref codeInjected);
}
private async void InitUI()
@@ -61,53 +61,6 @@ private async void InitUI()
catch (Exception) { } // Cancel if there is no internet connection
}
- private void InjectSynethiaCode()
- {
- if (codeInjected) return;
- codeInjected = true;
- foreach (Button b in Global.FindVisualChildren
+ Color="{DynamicResource AccentColor}" />
+ Foreground="{DynamicResource DarkGray}" />
@@ -104,7 +104,7 @@
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="16"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Text="" />
@@ -40,7 +40,7 @@ public PingPage()
{
InitializeComponent();
InitUI(); // Load the UI
- InjectSynethiaCode();
+ Loaded += (o, e) => SynethiaManager.InjectSynethiaCode(this, Global.SynethiaConfig.PagesInfo, 5, ref codeInjected);
}
private void InitUI()
@@ -49,60 +49,13 @@ private void InitUI()
IpTxt.Text = Global.Settings.TestSite ?? "https://leocorporation.dev";
}
- private void InjectSynethiaCode()
- {
- if (codeInjected) return;
- codeInjected = true;
- foreach (Button b in Global.FindVisualChildren(this))
- {
- b.Click += (sender, e) =>
- {
- Global.SynethiaConfig.PingPageInfo.InteractionCount++;
- };
- }
-
- // For each TextBox of the page
- foreach (TextBox textBox in Global.FindVisualChildren(this))
- {
- textBox.GotFocus += (o, e) =>
- {
- Global.SynethiaConfig.PingPageInfo.InteractionCount++;
- };
- }
-
- // For each CheckBox/RadioButton of the page
- foreach (CheckBox checkBox in Global.FindVisualChildren(this))
- {
- checkBox.Checked += (o, e) =>
- {
- Global.SynethiaConfig.PingPageInfo.InteractionCount++;
- };
- checkBox.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.PingPageInfo.InteractionCount++;
- };
- }
-
- foreach (RadioButton radioButton in Global.FindVisualChildren(this))
- {
- radioButton.Checked += (o, e) =>
- {
- Global.SynethiaConfig.PingPageInfo.InteractionCount++;
- };
- radioButton.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.PingPageInfo.InteractionCount++;
- };
- }
- }
-
internal void PingBtn_Click(object sender, RoutedEventArgs e)
{
IpTxt.Text = IpTxt.Text.Replace("https://", "").Replace("http://", "").TrimEnd('/'); // Remove the http:// or https://
MakePing(IpTxt.Text); // Make a ping to the specified IP
// Increment the interaction count of the ActionInfo in Global.SynethiaConfig
- Global.SynethiaConfig.ActionInfos.First(a => a.Action == Enums.AppActions.Ping).UsageCount++;
+ Global.SynethiaConfig.ActionsInfo.First(a => a.Name == "Ping.Execute").UsageCount++;
}
private async void MakePing(string address)
@@ -117,7 +70,7 @@ private async void MakePing(string address)
// Update UI
StatusIconTxt.Text = "\uF2DE";
- StatusIconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Gray"));
+ StatusIconTxt.Foreground = Global.GetBrushFromResource("Gray");
StatusTxt.Text = Properties.Resources.PingWait;
PingBtn.IsEnabled = false;
@@ -136,13 +89,13 @@ private async void MakePing(string address)
{
received++;
StatusIconTxt.Text = "\uF299";
- StatusIconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Green"));
+ StatusIconTxt.Foreground = Global.GetBrushFromResource("Green");
StatusTxt.Text = $"{Properties.Resources.PingSuccess}{nl}";
}
else
{
StatusIconTxt.Text = "\uF36E";
- StatusIconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Red"));
+ StatusIconTxt.Foreground = Global.GetBrushFromResource("Red");
StatusTxt.Text = $"{Properties.Resources.PingFail}{nl}";
IPAddressTxt.Text = ping.Status.ToString();
}
@@ -159,7 +112,7 @@ private async void MakePing(string address)
catch (Exception ex)
{
StatusIconTxt.Text = "\uF4AB";
- StatusIconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Gray"));
+ StatusIconTxt.Foreground = Global.GetBrushFromResource("Gray");
StatusTxt.Text = Properties.Resources.PingStatus;
MessageBox.Show(ex.Message, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
}
diff --git a/InternetTest/InternetTest/Pages/SettingsPage.xaml b/InternetTest/InternetTest/Pages/SettingsPage.xaml
index 3c49ad9a..3a2eaca3 100644
--- a/InternetTest/InternetTest/Pages/SettingsPage.xaml
+++ b/InternetTest/InternetTest/Pages/SettingsPage.xaml
@@ -11,7 +11,7 @@
d:DesignHeight="1450"
d:DesignWidth="800"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
@@ -30,7 +30,7 @@
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="16"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Text="" />
+ Color="{DynamicResource LightAccentColor}" />
@@ -97,7 +97,7 @@
@@ -136,9 +136,9 @@
HorizontalAlignment="Left"
VerticalAlignment="Center"
Background="Transparent"
- BorderBrush="{Binding Source={StaticResource AccentColor}}"
+ BorderBrush="{DynamicResource Accent}"
BorderThickness="2"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
SelectionChanged="LangComboBox_SelectionChanged"
Style="{DynamicResource ComboBoxStyle1}">
@@ -152,11 +152,11 @@
Margin="0 0 10 0"
Padding="10 5 10 5"
VerticalAlignment="Center"
- Background="{Binding Source={StaticResource AccentColor}}"
+ Background="{DynamicResource Accent}"
Click="LangApplyBtn_Click"
Cursor="Hand"
FontWeight="ExtraBold"
- Foreground="{Binding Source={StaticResource WindowButtonsHoverForeground1}}"
+ Foreground="{DynamicResource WindowButtonsHoverForeground1}"
Style="{StaticResource PrimaryButton}"
Visibility="Collapsed">
+ Foreground="{DynamicResource Foreground1}" />
@@ -178,8 +178,8 @@
@@ -293,7 +293,7 @@
@@ -332,9 +332,9 @@
HorizontalAlignment="Left"
VerticalAlignment="Center"
Background="Transparent"
- BorderBrush="{Binding Source={StaticResource AccentColor}}"
+ BorderBrush="{DynamicResource Accent}"
BorderThickness="2"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
SelectionChanged="MapProviderComboBox_SelectionChanged"
Style="{DynamicResource ComboBoxStyle1}">
@@ -348,8 +348,8 @@
@@ -382,7 +382,7 @@
BorderThickness="2"
Checked="UpdateNotifChk_Checked"
Content="{x:Static lang:Resources.NotifyUpdates}"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
Style="{DynamicResource CheckBoxStyle1}"
Unchecked="UpdateNotifChk_Checked" />
@@ -390,8 +390,8 @@
@@ -429,14 +429,13 @@
HorizontalAlignment="Left"
VerticalAlignment="Center"
Background="Transparent"
- BorderBrush="{Binding Source={StaticResource AccentColor}}"
+ BorderBrush="{DynamicResource Accent}"
BorderThickness="2"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
SelectionChanged="PageComboBox_SelectionChanged"
Style="{DynamicResource ComboBoxStyle1}">
-
@@ -454,7 +453,7 @@
BorderThickness="2"
Checked="UpdateOnStartChk_Checked"
Content="{x:Static lang:Resources.CheckUpdatesOnStart}"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
Style="{DynamicResource CheckBoxStyle1}"
Unchecked="UpdateOnStartChk_Checked" />
@@ -510,7 +509,7 @@
VerticalAlignment="Center"
FontFamily="..\Fonts\#FluentSystemIcons-Regular"
FontSize="22"
- Text="" />
+ Text="" />
@@ -547,11 +546,11 @@
x:Name="HttpRadio"
VerticalAlignment="Center"
Background="Transparent"
- BorderBrush="{Binding Source={StaticResource AccentColor}}"
+ BorderBrush="{DynamicResource Accent}"
Checked="HttpRadio_Checked"
Content="{x:Static lang:Resources.HTTP}"
FontWeight="Bold"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
GroupName="Protocol"
Style="{DynamicResource RadioButtonStyle1}"
Unchecked="HttpRadio_Checked" />
@@ -561,14 +560,14 @@
+ Color="{DynamicResource AccentColor}" />
+ Foreground="{DynamicResource Foreground1}" />
+ Foreground="{DynamicResource Foreground1}" />
@@ -609,8 +608,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -642,14 +723,14 @@
+ Color="{DynamicResource AccentColor}" />
@@ -665,11 +746,11 @@
x:Name="HopsApplyBtn"
Padding="10 5 10 5"
VerticalAlignment="Center"
- Background="{Binding Source={StaticResource AccentColor}}"
+ Background="{DynamicResource Accent}"
Click="HopsApplyBtn_Click"
Cursor="Hand"
FontWeight="ExtraBold"
- Foreground="{Binding Source={StaticResource WindowButtonsHoverForeground1}}"
+ Foreground="{DynamicResource WindowButtonsHoverForeground1}"
Style="{StaticResource PrimaryButton}"
Visibility="Visible">
+ Foreground="{DynamicResource Foreground1}" />
@@ -692,14 +773,14 @@
+ Color="{DynamicResource AccentColor}" />
@@ -715,11 +796,11 @@
x:Name="TimeOutApplyBtn"
Padding="10 5 10 5"
VerticalAlignment="Center"
- Background="{Binding Source={StaticResource AccentColor}}"
+ Background="{DynamicResource Accent}"
Click="TimeOutApplyBtn_Click"
Cursor="Hand"
FontWeight="ExtraBold"
- Foreground="{Binding Source={StaticResource WindowButtonsHoverForeground1}}"
+ Foreground="{DynamicResource WindowButtonsHoverForeground1}"
Style="{StaticResource PrimaryButton}"
Visibility="Visible">
+ Foreground="{DynamicResource Foreground1}" />
@@ -742,8 +823,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -775,11 +898,11 @@
Margin="0 0 10 0"
Padding="10 5 10 5"
VerticalAlignment="Center"
- Background="{Binding Source={StaticResource AccentColor}}"
+ Background="{DynamicResource Accent}"
Click="ImportBtn_Click"
Cursor="Hand"
FontWeight="ExtraBold"
- Foreground="{Binding Source={StaticResource WindowButtonsHoverForeground1}}"
+ Foreground="{DynamicResource WindowButtonsHoverForeground1}"
Style="{StaticResource PrimaryButton}">
@@ -834,7 +957,7 @@
Cursor="Hand"
FontSize="14"
FontWeight="ExtraBold"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Style="{DynamicResource StandardButton}">
+
+
+
+
+
+
diff --git a/InternetTest/InternetTest/Pages/SettingsPage.xaml.cs b/InternetTest/InternetTest/Pages/SettingsPage.xaml.cs
index a756c7eb..41bcb434 100644
--- a/InternetTest/InternetTest/Pages/SettingsPage.xaml.cs
+++ b/InternetTest/InternetTest/Pages/SettingsPage.xaml.cs
@@ -26,6 +26,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using Microsoft.Win32;
using PeyrSharp.Core;
using PeyrSharp.Env;
+using Synethia;
using System;
using System.Diagnostics;
using System.IO;
@@ -52,7 +53,7 @@ public SettingsPage()
string lastVersion = await Update.GetLastVersionAsync(Global.LastVersionLink); // Get last version
if (MessageBox.Show(Properties.Resources.InstallConfirmMsg, $"{Properties.Resources.InstallVersion} {lastVersion}", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.Yes)
{
- SynethiaManager.Save(Global.SynethiaConfig);
+ SynethiaManager.Save(Global.SynethiaConfig, Global.SynethiaPath);
HistoryManager.Save(Global.History);
SettingsManager.Save();
@@ -69,7 +70,11 @@ public SettingsPage()
private async void InitUI()
{
// About section
- VersionTxt.Text = Global.Version; // Update the current version label
+#if PORTABLE
+ VersionTxt.Text = Global.Version + " (Portable)";
+#else
+ VersionTxt.Text = Global.Version;
+#endif
// Select the default theme border
ThemeSelectedBorder = Global.Settings.Theme switch
@@ -107,10 +112,16 @@ private async void InitUI()
HttpRadio.IsChecked = !Global.Settings.UseHttps;
SiteTxt.Text = Global.Settings.TestSite;
+ // DownDetector section
+ IntervalTxt.Text = Global.Settings.DefaultTimeInterval.ToString();
+
// Trace route section
HopsTxt.Text = Global.Settings.TraceRouteMaxHops.ToString();
TimeOutTxt.Text = Global.Settings.TraceRouteMaxTimeOut.ToString();
+ // Adapters section
+ HideNetworkAdaptersChk.IsChecked = Global.Settings.HideDisabledAdapters;
+
// Data section
UseSynethiaChk.IsChecked = Global.Settings.UseSynethia;
@@ -141,14 +152,17 @@ private async void CheckUpdateBtn_Click(object sender, RoutedEventArgs e)
if (Update.IsAvailable(Global.Version, lastVersion))
{
UpdateTxt.Text = Properties.Resources.AvailableUpdates;
-
+#if PORTABLE
+ MessageBox.Show(Properties.Resources.PortableNoAutoUpdates, $"{Properties.Resources.InstallVersion} {lastVersion}", MessageBoxButton.OK, MessageBoxImage.Information);
+ return;
+#else
if (MessageBox.Show(Properties.Resources.InstallConfirmMsg, $"{Properties.Resources.InstallVersion} {lastVersion}", MessageBoxButton.YesNo, MessageBoxImage.Information) == MessageBoxResult.No)
{
return;
}
-
+#endif
// If the user wants to proceed.
- SynethiaManager.Save(Global.SynethiaConfig);
+ SynethiaManager.Save(Global.SynethiaConfig, Global.SynethiaPath);
HistoryManager.Save(Global.History);
SettingsManager.Save();
@@ -164,7 +178,7 @@ private async void CheckUpdateBtn_Click(object sender, RoutedEventArgs e)
Border ThemeSelectedBorder;
private void Border_MouseEnter(object sender, MouseEventArgs e)
{
- ((Border)sender).BorderBrush = new SolidColorBrush { Color = Global.GetColorFromResource("AccentColor") };
+ ((Border)sender).BorderBrush = Global.GetBrushFromResource("Accent");
}
private void Border_MouseLeave(object sender, MouseEventArgs e)
@@ -184,60 +198,42 @@ private void LightBorder_MouseLeftButtonUp(object sender, MouseButtonEventArgs e
{
ResetBorders();
ThemeSelectedBorder = (Border)sender;
- ((Border)sender).BorderBrush = new SolidColorBrush { Color = Global.GetColorFromResource("AccentColor") };
+ ((Border)sender).BorderBrush = Global.GetBrushFromResource("Accent");
Global.Settings.Theme = Themes.Light;
SettingsManager.Save();
- if (MessageBox.Show(Properties.Resources.NeedRestartToApplyChanges, Properties.Resources.Settings, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
- {
- return;
- }
-
- SynethiaManager.Save(Global.SynethiaConfig);
+ SynethiaManager.Save(Global.SynethiaConfig, Global.SynethiaPath);
HistoryManager.Save(Global.History);
- Process.Start(Directory.GetCurrentDirectory() + @"\InternetTest.exe");
- Application.Current.Shutdown();
+ Global.ChangeTheme();
}
private void DarkBorder_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
ResetBorders();
ThemeSelectedBorder = (Border)sender;
- ((Border)sender).BorderBrush = new SolidColorBrush { Color = Global.GetColorFromResource("AccentColor") };
+ ((Border)sender).BorderBrush = Global.GetBrushFromResource("Accent");
Global.Settings.Theme = Themes.Dark;
SettingsManager.Save();
- if (MessageBox.Show(Properties.Resources.NeedRestartToApplyChanges, Properties.Resources.Settings, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
- {
- return;
- }
-
- SynethiaManager.Save(Global.SynethiaConfig);
+ SynethiaManager.Save(Global.SynethiaConfig, Global.SynethiaPath);
HistoryManager.Save(Global.History);
- Process.Start(Directory.GetCurrentDirectory() + @"\InternetTest.exe");
- Application.Current.Shutdown();
+ Global.ChangeTheme();
}
private void SystemBorder_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
ResetBorders();
ThemeSelectedBorder = (Border)sender;
- ((Border)sender).BorderBrush = new SolidColorBrush { Color = Global.GetColorFromResource("AccentColor") };
+ ((Border)sender).BorderBrush = Global.GetBrushFromResource("Accent");
Global.Settings.Theme = Themes.System;
SettingsManager.Save();
- if (MessageBox.Show(Properties.Resources.NeedRestartToApplyChanges, Properties.Resources.Settings, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
- {
- return;
- }
-
- SynethiaManager.Save(Global.SynethiaConfig);
+ SynethiaManager.Save(Global.SynethiaConfig, Global.SynethiaPath);
HistoryManager.Save(Global.History);
- Process.Start(Directory.GetCurrentDirectory() + @"\InternetTest.exe");
- Application.Current.Shutdown();
+ Global.ChangeTheme();
}
private void LangComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -256,7 +252,7 @@ private void LangApplyBtn_Click(object sender, RoutedEventArgs e)
return;
}
- SynethiaManager.Save(Global.SynethiaConfig);
+ SynethiaManager.Save(Global.SynethiaConfig, Global.SynethiaPath);
HistoryManager.Save(Global.History);
Process.Start(Directory.GetCurrentDirectory() + @"\InternetTest.exe");
@@ -349,7 +345,7 @@ private void ResetSettingsLink_Click(object sender, RoutedEventArgs e)
return;
}
- SynethiaManager.Save(Global.SynethiaConfig);
+ SynethiaManager.Save(Global.SynethiaConfig, Global.SynethiaPath);
HistoryManager.Save(Global.History);
Process.Start(Directory.GetCurrentDirectory() + @"\InternetTest.exe");
Application.Current.Shutdown();
@@ -377,7 +373,7 @@ private void ResetSynethiaLink_Click(object sender, RoutedEventArgs e)
// If the user wants to proceed, reset Syenthia config file.
Global.SynethiaConfig = new();
- SynethiaManager.Save(Global.SynethiaConfig);
+ SynethiaManager.Save(Global.SynethiaConfig, Global.SynethiaPath);
// Ask the user if they want to restart the application to apply changes.
if (MessageBox.Show(Properties.Resources.NeedRestartToApplyChanges, Properties.Resources.Settings, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No)
@@ -427,4 +423,33 @@ private void LocateIpOnStartChk_Checked(object sender, RoutedEventArgs e)
Global.Settings.LaunchIpLocationOnStart = LocateIpOnStartChk.IsChecked;
SettingsManager.Save();
}
+
+ private void EraseWiFisLink_Click(object sender, RoutedEventArgs e)
+ {
+ if (!Directory.Exists(FileSys.AppDataPath + @"\Léo Corporation\InternetTest Pro\WiFis")) return;
+
+ if (MessageBox.Show(Properties.Resources.EraseWiFiPasswordsFilesMsg, Properties.Resources.InternetTestPro, MessageBoxButton.YesNoCancel, MessageBoxImage.Question) != MessageBoxResult.Yes) return;
+
+ string path = FileSys.AppDataPath + @"\Léo Corporation\InternetTest Pro\WiFis";
+ string[] files = Directory.GetFiles(path);
+ for (int i = 0; i < files.Length; i++)
+ {
+ File.Delete(files[i]); // Remove the temp file
+ }
+ Directory.Delete(path); // Delete the temp directory
+ }
+
+ private void IntervalApplyBtn_Click(object sender, RoutedEventArgs e)
+ {
+ if (string.IsNullOrEmpty(IntervalTxt.Text)) return;
+
+ Global.Settings.DefaultTimeInterval = int.Parse(IntervalTxt.Text);
+ SettingsManager.Save();
+ }
+
+ private void NetworkAdaptersChk_Checked(object sender, RoutedEventArgs e)
+ {
+ Global.Settings.HideDisabledAdapters = HideNetworkAdaptersChk.IsChecked;
+ SettingsManager.Save();
+ }
}
diff --git a/InternetTest/InternetTest/Pages/StatusPage.xaml b/InternetTest/InternetTest/Pages/StatusPage.xaml
deleted file mode 100644
index b85de151..00000000
--- a/InternetTest/InternetTest/Pages/StatusPage.xaml
+++ /dev/null
@@ -1,385 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/InternetTest/InternetTest/Pages/StatusPage.xaml.cs b/InternetTest/InternetTest/Pages/StatusPage.xaml.cs
deleted file mode 100644
index 5147b108..00000000
--- a/InternetTest/InternetTest/Pages/StatusPage.xaml.cs
+++ /dev/null
@@ -1,253 +0,0 @@
-/*
-MIT License
-
-Copyright (c) Léo Corporation
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
-using InternetTest.Classes;
-using PeyrSharp.Core.Converters;
-using System;
-using System.Diagnostics;
-using System.Linq;
-using System.Net;
-using System.Net.Http;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media;
-using System.Windows.Threading;
-
-namespace InternetTest.Pages;
-///
-/// Interaction logic for StatusPage.xaml
-///
-public partial class StatusPage : Page
-{
- bool codeInjected = !Global.Settings.UseSynethia;
- public StatusPage()
- {
- InitializeComponent();
- InitUI(); // Load the UI
- Loaded += (o, e) => InjectSynethiaCode();
- }
-
- private void InjectSynethiaCode()
- {
- if (codeInjected) return;
- codeInjected = true;
- foreach (Button b in Global.FindVisualChildren(this))
- {
- b.Click += (sender, e) =>
- {
- Global.SynethiaConfig.StatusPageInfo.InteractionCount++;
- };
- }
-
- // For each TextBox of the page
- foreach (TextBox textBox in Global.FindVisualChildren(this))
- {
- textBox.GotFocus += (o, e) =>
- {
- Global.SynethiaConfig.StatusPageInfo.InteractionCount++;
- };
- }
-
- // For each CheckBox/RadioButton of the page
- foreach (CheckBox checkBox in Global.FindVisualChildren(this))
- {
- checkBox.Checked += (o, e) =>
- {
- Global.SynethiaConfig.StatusPageInfo.InteractionCount++;
- };
- checkBox.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.StatusPageInfo.InteractionCount++;
- };
- }
-
- foreach (RadioButton radioButton in Global.FindVisualChildren(this))
- {
- radioButton.Checked += (o, e) =>
- {
- Global.SynethiaConfig.StatusPageInfo.InteractionCount++;
- };
- radioButton.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.StatusPageInfo.InteractionCount++;
- };
- }
- }
-
- private void InitUI()
- {
- TitleTxt.Text = $"{Properties.Resources.WebUtilities} > {Properties.Resources.Status}"; // Set the title
-
- if (!Global.Settings.TestOnStart) return;
- LaunchTest(Global.Settings.TestSite ?? "https://leocorporation"); // Launch the test
- }
-
- private async void LaunchTest(string customSite)
- {
- try
- {
- // Show the waiting screen
- StatusIconTxt.Visibility = Visibility.Collapsed;
- Spinner.Visibility = Visibility.Visible;
-
- StatusTxt.Text = Properties.Resources.TestInProgress;
- TestBtn.IsEnabled = false;
- SpeedTestBtn.IsEnabled = false;
-
- // Launch the test
- // Part 1: Get the status code and start timer
- int time = 0;
- DispatcherTimer dispatcherTimer = new() { Interval = TimeSpan.FromMilliseconds(1) };
- dispatcherTimer.Tick += (o, e) => time++;
- dispatcherTimer.Start();
-
- HttpResponseMessage response = await new HttpClient().GetAsync(customSite);
-
- int code = (int)response.StatusCode;
- string message = response.ReasonPhrase;
- InfoTxt.Text = response.Headers.ToString();
-
- dispatcherTimer.Stop();
-
- DetailsStatusTxt.Text = code.ToString();
- DetailsMessageTxt.Text = message;
-
- // Part 2: Display time
- DetailsTimeTxt.Text = $"{time}ms";
-
- // Part 3: Display the result
- if (code != 400)
- {
- StatusIconTxt.Text = "\uF299";
- StatusIconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Green"));
- StatusTxt.Text = Properties.Resources.Connected;
- }
- else
- {
- StatusIconTxt.Text = "\uF36E";
- StatusIconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Red"));
- StatusTxt.Text = Properties.Resources.NotConnected;
- }
-
- Global.History.StatusHistory.Add(new StatusHistory(Time.DateTimeToUnixTime(DateTime.Now), StatusIconTxt.Text, true));
- }
- catch (HttpRequestException)
- {
- StatusIconTxt.Text = "\uF36E";
- StatusIconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Red"));
- StatusTxt.Text = Properties.Resources.NotConnected;
- DetailsStatusTxt.Text = "N/A";
- DetailsMessageTxt.Text = Properties.Resources.Error;
- DetailsTimeTxt.Text = "0ms";
- Global.History.StatusHistory.Add(new StatusHistory(Time.DateTimeToUnixTime(DateTime.Now), StatusIconTxt.Text, false));
-
- }
-
- TestBtn.IsEnabled = true;
- SpeedTestBtn.IsEnabled = true;
- StatusIconTxt.Visibility = Visibility.Visible;
- Spinner.Visibility = Visibility.Collapsed;
- }
-
- internal void TestBtn_Click(object sender, RoutedEventArgs e)
- {
- LaunchTest(Global.Settings.TestSite ?? "https://leocorporation.dev");
- // Increment the interaction count of the ActionInfo in Global.SynethiaConfig
- Global.SynethiaConfig.ActionInfos.First(a => a.Action == Enums.AppActions.Test).UsageCount++;
- }
-
- private void BrowserBtn_Click(object sender, RoutedEventArgs e)
- {
- Process.Start("explorer.exe", Global.Settings.TestSite ?? "https://leocorporation.dev");
- }
-
- private void TextBlock_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
- {
- Clipboard.SetText(((TextBlock)sender).Text);
- }
-
- private void AdvancedBtn_Click(object sender, RoutedEventArgs e)
- {
- AdvancedOptions.Visibility = AdvancedOptions.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
- AdvancedBtn.Content = AdvancedOptions.Visibility == Visibility.Visible ? "\uF36A" : "\uF4A4";
- }
-
- private async void SpeedTestBtn_Click(object sender, RoutedEventArgs e)
- {
- try
- {
- // Show the waiting screen
- StatusTxt.Text = Properties.Resources.TestInProgress;
- StatusIconTxt.Visibility = Visibility.Collapsed;
- Spinner.Visibility = Visibility.Visible;
- TestBtn.IsEnabled = false;
- SpeedTestBtn.IsEnabled = false;
-
- // Test
- string targetUrl = "http://speedtest.tele2.net/10MB.zip";
-
- long fileSize = await DownloadFile(targetUrl);
- double speedMbps = fileSize / 1000000.0;
-
- SpeedTxt.Text = $"{speedMbps:0.00} MB/s";
-
- // Case of sucess
- StatusIconTxt.Text = "\uF299";
- StatusIconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Green"));
- StatusTxt.Text = Properties.Resources.SpeedTestSucess;
- }
- catch
- {
- StatusIconTxt.Text = "\uF36E";
- StatusIconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Red"));
- StatusTxt.Text = Properties.Resources.SpeedTestFailed;
- }
-
- TestBtn.IsEnabled = true;
- SpeedTestBtn.IsEnabled = true;
- StatusIconTxt.Visibility = Visibility.Visible;
- Spinner.Visibility = Visibility.Collapsed;
- }
-
- static async Task DownloadFile(string url)
- {
- Stopwatch stopwatch = Stopwatch.StartNew();
-
- using (HttpClient client = new HttpClient())
- {
- HttpResponseMessage response = await client.GetAsync(url);
-
- if (response.IsSuccessStatusCode)
- {
- byte[] data = await response.Content.ReadAsByteArrayAsync();
- stopwatch.Stop();
- return data.Length;
- }
- else
- {
- return 0;
- }
- }
- }
-}
diff --git a/InternetTest/InternetTest/Pages/TraceroutePage.xaml b/InternetTest/InternetTest/Pages/TraceroutePage.xaml
index 6c339962..1ef2131c 100644
--- a/InternetTest/InternetTest/Pages/TraceroutePage.xaml
+++ b/InternetTest/InternetTest/Pages/TraceroutePage.xaml
@@ -12,7 +12,7 @@
d:DesignWidth="800"
Background="Transparent"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
@@ -28,7 +28,7 @@
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="16"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Text="" />
+ Color="{DynamicResource AccentColor}" />
@@ -71,7 +71,8 @@
Background="Transparent"
BorderThickness="0"
FontWeight="Bold"
- Foreground="{Binding Source={StaticResource DarkGray}}" />
+ Foreground="{DynamicResource DarkGray}"
+ Keyboard.KeyUp="AddressTxt_KeyUp" />
@@ -92,13 +93,13 @@
x:Name="TraceBtn"
Margin="5 10"
Padding="5 2"
- Background="{Binding Source={StaticResource AccentColor}}"
+ Background="{DynamicResource Accent}"
BorderThickness="0"
Click="TraceBtn_Click"
Content="{x:Static lang:Resources.Trace}"
Cursor="Hand"
FontWeight="ExtraBold"
- Foreground="{Binding Source={StaticResource WindowButtonsHoverForeground1}}"
+ Foreground="{DynamicResource WindowButtonsHoverForeground1}"
Style="{DynamicResource PrimaryButton}" />
diff --git a/InternetTest/InternetTest/Pages/TraceroutePage.xaml.cs b/InternetTest/InternetTest/Pages/TraceroutePage.xaml.cs
index 7d815b64..38ccbab6 100644
--- a/InternetTest/InternetTest/Pages/TraceroutePage.xaml.cs
+++ b/InternetTest/InternetTest/Pages/TraceroutePage.xaml.cs
@@ -24,21 +24,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using InternetTest.Classes;
using InternetTest.UserControls;
-using System;
-using System.Collections.Generic;
+using Synethia;
using System.Linq;
using System.Net.NetworkInformation;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
namespace InternetTest.Pages;
///
@@ -50,56 +40,10 @@ public partial class TraceroutePage : Page
public TraceroutePage()
{
InitializeComponent();
- Loaded += (o, e) => InjectSynethiaCode();
+ Loaded += (o, e) => SynethiaManager.InjectSynethiaCode(this, Global.SynethiaConfig.PagesInfo, 6, ref codeInjected);
InitUI();
}
- private void InjectSynethiaCode()
- {
- if (codeInjected) return;
- codeInjected = true;
- foreach (Button b in Global.FindVisualChildren(this))
- {
- b.Click += (sender, e) =>
- {
- Global.SynethiaConfig.TraceRoutePageInfo.InteractionCount++;
- };
- }
-
- // For each TextBox of the page
- foreach (TextBox textBox in Global.FindVisualChildren(this))
- {
- textBox.GotFocus += (o, e) =>
- {
- Global.SynethiaConfig.TraceRoutePageInfo.InteractionCount++;
- };
- }
-
- // For each CheckBox/RadioButton of the page
- foreach (CheckBox checkBox in Global.FindVisualChildren(this))
- {
- checkBox.Checked += (o, e) =>
- {
- Global.SynethiaConfig.TraceRoutePageInfo.InteractionCount++;
- };
- checkBox.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.TraceRoutePageInfo.InteractionCount++;
- };
- }
-
- foreach (RadioButton radioButton in Global.FindVisualChildren(this))
- {
- radioButton.Checked += (o, e) =>
- {
- Global.SynethiaConfig.TraceRoutePageInfo.InteractionCount++;
- };
- radioButton.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.TraceRoutePageInfo.InteractionCount++;
- };
- }
- }
private void InitUI()
{
@@ -114,7 +58,13 @@ private void DismissBtn_Click(object sender, RoutedEventArgs e)
private async void TraceBtn_Click(object sender, RoutedEventArgs e)
{
// Increment the interaction count of the ActionInfo in Global.SynethiaConfig
- Global.SynethiaConfig.ActionInfos.First(a => a.Action == Enums.AppActions.TraceRoute).UsageCount++;
+ Global.SynethiaConfig.ActionsInfo.First(a => a.Name == "Traceroute.Execute").UsageCount++;
+
+ if (string.IsNullOrEmpty(AddressTxt.Text) || string.IsNullOrWhiteSpace(AddressTxt.Text))
+ {
+ MessageBox.Show(Properties.Resources.InvalidURLMsg, Properties.Resources.GetDnsInfo, MessageBoxButton.OK, MessageBoxImage.Error);
+ return;
+ }
// Show the waiting screen
TraceBtn.IsEnabled = false;
@@ -151,7 +101,7 @@ private async void TraceBtn_Click(object sender, RoutedEventArgs e)
StatusPanel.Visibility = Visibility.Visible;
WaitingScreen.Visibility = Visibility.Collapsed;
TracertPanel.Visibility = Visibility.Visible;
-
+
WaitTxt.Text = Properties.Resources.TraceRouteInformation; // Reset text to default
WaitIconTxt.Visibility = Visibility.Visible;
Spinner.Visibility = Visibility.Collapsed;
@@ -160,4 +110,12 @@ private async void TraceBtn_Click(object sender, RoutedEventArgs e)
TraceBtn.IsEnabled = true;
}
+
+ private void AddressTxt_KeyUp(object sender, System.Windows.Input.KeyEventArgs e)
+ {
+ if (e.Key == System.Windows.Input.Key.Enter)
+ {
+ TraceBtn_Click(sender, e);
+ }
+ }
}
diff --git a/InternetTest/InternetTest/Pages/WiFiNetworksPage.xaml b/InternetTest/InternetTest/Pages/WiFiNetworksPage.xaml
index 079812ee..3db4ed28 100644
--- a/InternetTest/InternetTest/Pages/WiFiNetworksPage.xaml
+++ b/InternetTest/InternetTest/Pages/WiFiNetworksPage.xaml
@@ -12,7 +12,7 @@
d:DesignWidth="800"
Background="Transparent"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
@@ -27,7 +27,7 @@
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="16"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Text="" />
@@ -82,7 +82,7 @@
Background="Transparent"
BorderThickness="0"
Checked="AdaptersBtn_Click"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Style="{DynamicResource TabRadioButton}">
@@ -111,14 +111,14 @@
Margin="10 3 3 3"
HorizontalAlignment="Left"
VerticalAlignment="Center"
- Background="{Binding Source={StaticResource CardBackground}}"
+ Background="{DynamicResource CardBackground}"
CornerRadius="5">
+ Color="{DynamicResource AccentColor}" />
@@ -134,7 +134,7 @@
Background="Transparent"
BorderThickness="0"
FontWeight="Bold"
- Foreground="{Binding Source={StaticResource DarkGray}}"
+ Foreground="{DynamicResource DarkGray}"
TextChanged="SearchTxt_TextChanged" />
@@ -165,7 +165,7 @@
Checked="ShowHiddenChk_Checked"
Content="{x:Static lang:Resources.ShowDisabled}"
FontWeight="Bold"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
IsChecked="True"
Style="{DynamicResource CheckBoxStyle1}"
Unchecked="ShowHiddenChk_Checked"
@@ -175,12 +175,12 @@
Grid.Row="1"
Margin="5"
Padding="5"
- Background="{Binding Source={StaticResource LightAccentColor}}"
+ Background="{DynamicResource LightAccent}"
Click="RefreshBtn_Click"
Content="{x:Static lang:Resources.Refresh}"
Cursor="Hand"
FontWeight="ExtraBold"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Style="{DynamicResource PrimaryButton}" />
@@ -216,6 +216,7 @@
HorizontalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="48"
+ Foreground="{DynamicResource Accent}"
RenderTransformOrigin="0.5,0.5"
Text="">
diff --git a/InternetTest/InternetTest/Pages/WiFiNetworksPage.xaml.cs b/InternetTest/InternetTest/Pages/WiFiNetworksPage.xaml.cs
index c38a7d1e..c82de92c 100644
--- a/InternetTest/InternetTest/Pages/WiFiNetworksPage.xaml.cs
+++ b/InternetTest/InternetTest/Pages/WiFiNetworksPage.xaml.cs
@@ -25,21 +25,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using InternetTest.Classes;
using InternetTest.UserControls;
using ManagedNativeWifi;
+using Synethia;
using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Net.NetworkInformation;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
namespace InternetTest.Pages;
///
@@ -53,55 +43,10 @@ public WiFiNetworksPage()
{
InitializeComponent();
InitUI(); // Load the UI
- Loaded += (o, e) => InjectSynethiaCode();
- }
-
- private void InjectSynethiaCode()
- {
- if (codeInjected) return;
- codeInjected = true;
- foreach (Button b in Global.FindVisualChildren(this))
- {
- b.Click += (sender, e) =>
- {
- Global.SynethiaConfig.DnsPageInfo.InteractionCount++;
- };
- }
+ Loaded += (o, e) => SynethiaManager.InjectSynethiaCode(this, Global.SynethiaConfig.PagesInfo, 2, ref codeInjected);
- // For each TextBox of the page
- foreach (TextBox textBox in Global.FindVisualChildren(this))
- {
- textBox.GotFocus += (o, e) =>
- {
- Global.SynethiaConfig.DnsPageInfo.InteractionCount++;
- };
- }
-
- // For each CheckBox/RadioButton of the page
- foreach (CheckBox checkBox in Global.FindVisualChildren(this))
- {
- checkBox.Checked += (o, e) =>
- {
- Global.SynethiaConfig.DnsPageInfo.InteractionCount++;
- };
- checkBox.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.DnsPageInfo.InteractionCount++;
- };
- }
-
- foreach (RadioButton radioButton in Global.FindVisualChildren(this))
- {
- radioButton.Checked += (o, e) =>
- {
- Global.SynethiaConfig.DnsPageInfo.InteractionCount++;
- };
- radioButton.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.DnsPageInfo.InteractionCount++;
- };
- }
}
+
bool loaded = false;
private async void InitUI()
{
@@ -110,6 +55,7 @@ private async void InitUI()
TitleTxt.Text = $"{Properties.Resources.WebUtilities} > {Properties.Resources.WiFiNetworks}"; // Set the title
WiFiDisplayer.Children.Clear();
+ ShowHiddenChk.IsChecked = !Global.Settings.HideDisabledAdapters;
WiFiDisplayer.Visibility = Visibility.Collapsed;
ScanningPanel.Visibility = Visibility.Visible;
@@ -224,5 +170,5 @@ private void Search(string query)
private void DismissBtn_Click(object sender, RoutedEventArgs e)
{
SearchTxt.Text = "";
- }
+ }
}
diff --git a/InternetTest/InternetTest/Pages/WiFiPasswordsPage.xaml b/InternetTest/InternetTest/Pages/WiFiPasswordsPage.xaml
index d63df01d..69c0a58d 100644
--- a/InternetTest/InternetTest/Pages/WiFiPasswordsPage.xaml
+++ b/InternetTest/InternetTest/Pages/WiFiPasswordsPage.xaml
@@ -12,7 +12,7 @@
d:DesignWidth="800"
Background="Transparent"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
@@ -27,7 +27,7 @@
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="16"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Text="" />
+ Color="{DynamicResource AccentColor}" />
@@ -65,7 +65,7 @@
Background="Transparent"
BorderThickness="0"
FontWeight="Bold"
- Foreground="{Binding Source={StaticResource DarkGray}}"
+ Foreground="{DynamicResource DarkGray}"
TextChanged="TextBox_TextChanged" />
@@ -89,12 +89,12 @@
Margin="5"
Padding="5"
HorizontalAlignment="Right"
- Background="{Binding Source={StaticResource LightAccentColor}}"
+ Background="{DynamicResource LightAccent}"
Click="GetWiFiBtn_Click"
Content="{x:Static lang:Resources.GetWiFi}"
Cursor="Hand"
FontWeight="ExtraBold"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Style="{DynamicResource PrimaryButton}" />
diff --git a/InternetTest/InternetTest/Pages/WiFiPasswordsPage.xaml.cs b/InternetTest/InternetTest/Pages/WiFiPasswordsPage.xaml.cs
index c54129d6..67869646 100644
--- a/InternetTest/InternetTest/Pages/WiFiPasswordsPage.xaml.cs
+++ b/InternetTest/InternetTest/Pages/WiFiPasswordsPage.xaml.cs
@@ -24,6 +24,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using InternetTest.Classes;
using InternetTest.UserControls;
using PeyrSharp.Env;
+using Synethia;
using System;
using System.Collections.Generic;
using System.Diagnostics;
@@ -45,7 +46,7 @@ public WiFiPasswordsPage()
{
InitializeComponent();
InitUI();
- InjectSynethiaCode();
+ Loaded += (o, e) => SynethiaManager.InjectSynethiaCode(this, Global.SynethiaConfig.PagesInfo, 7, ref codeInjected);
}
Placeholder Placeholder = new(Properties.Resources.NothingToShow, "\uF227");
@@ -53,71 +54,21 @@ private void InitUI()
{
TitleTxt.Text = $"{Properties.Resources.Commands} > {Properties.Resources.WifiPasswords}";
PlaceholderGrid.Children.Add(Placeholder); // Show the placeholder instead of an empty page
- }
-
- private void InjectSynethiaCode()
- {
- if (codeInjected) return;
- codeInjected = true;
- foreach (Button b in Global.FindVisualChildren(this))
- {
- b.Click += (sender, e) =>
- {
- Global.SynethiaConfig.WiFiPasswordsPageInfo.InteractionCount++;
- };
- }
-
- // For each TextBox of the page
- foreach (TextBox textBox in Global.FindVisualChildren(this))
- {
- textBox.GotFocus += (o, e) =>
- {
- Global.SynethiaConfig.WiFiPasswordsPageInfo.InteractionCount++;
- };
- }
-
- // For each CheckBox/RadioButton of the page
- foreach (CheckBox checkBox in Global.FindVisualChildren(this))
- {
- checkBox.Checked += (o, e) =>
- {
- Global.SynethiaConfig.WiFiPasswordsPageInfo.InteractionCount++;
- };
- checkBox.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.WiFiPasswordsPageInfo.InteractionCount++;
- };
- }
- foreach (RadioButton radioButton in Global.FindVisualChildren(this))
+ try
{
- radioButton.Checked += (o, e) =>
- {
- Global.SynethiaConfig.WiFiPasswordsPageInfo.InteractionCount++;
- };
- radioButton.Unchecked += (o, e) =>
- {
- Global.SynethiaConfig.WiFiPasswordsPageInfo.InteractionCount++;
- };
+ if (!Directory.Exists(FileSys.AppDataPath + @"\Léo Corporation\InternetTest Pro\WiFis")) return;
+ LoadWiFiInfo(FileSys.AppDataPath + @"\Léo Corporation\InternetTest Pro\WiFis");
}
+ catch { }
}
internal async void GetWiFiBtn_Click(object sender, RoutedEventArgs e)
{
- await GetWiFiNetworksInfo(); // Update the UI
- if (WiFiItemDisplayer.Children.Count == 0)
- {
- PlaceholderGrid.Visibility = Visibility.Visible;
- Placeholder.Visibility = Visibility.Visible;
- }
- else
- {
- PlaceholderGrid.Visibility = Visibility.Collapsed;
- Placeholder.Visibility = Visibility.Collapsed;
- }
+ await GetWiFiNetworksInfo(); // Update the UI
// Increment the interaction count of the ActionInfo in Global.SynethiaConfig
- Global.SynethiaConfig.ActionInfos.First(a => a.Action == Enums.AppActions.GetWiFiPasswords).UsageCount++;
+ Global.SynethiaConfig.ActionsInfo.First(a => a.Name == "WiFiPasswords.Get").UsageCount++;
}
internal async Task GetWiFiNetworksInfo()
@@ -126,11 +77,9 @@ internal async Task GetWiFiNetworksInfo()
try
{
WiFiItemDisplayer.Children.Clear(); // Clear the panel
- PlaceholderGrid.Visibility = Visibility.Collapsed; // Hide the placeholder
- Placeholder.Visibility = Visibility.Collapsed; // Hide the placeholder
// Check if the temp directory exists
- string path = FileSys.AppDataPath + @"\Léo Corporation\InternetTest Pro\Temp";
+ string path = FileSys.AppDataPath + @"\Léo Corporation\InternetTest Pro\WiFis";
if (!Directory.Exists(path))
{
@@ -148,28 +97,40 @@ internal async Task GetWiFiNetworksInfo()
await process.WaitForExitAsync();
// Read the files
- string[] files = Directory.GetFiles(path);
- for (int i = 0; i < files.Length; i++)
- {
- XmlSerializer serializer = new(typeof(WLANProfile));
- StreamReader streamReader = new(files[i]); // Where the file is going to be read
-
- var test = (WLANProfile?)serializer.Deserialize(streamReader);
+ LoadWiFiInfo(path);
+ }
+ catch (Exception ex)
+ {
+ MessageBox.Show(ex.Message, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
+ }
+ }
- if (test != null)
- {
- WiFiItemDisplayer.Children.Add(new WiFiInfoItem(test));
- }
- streamReader.Close();
+ internal void LoadWiFiInfo(string path)
+ {
+ string[] files = Directory.GetFiles(path);
+ for (int i = 0; i < files.Length; i++)
+ {
+ XmlSerializer serializer = new(typeof(WLANProfile));
+ StreamReader streamReader = new(files[i]); // Where the file is going to be read
- File.Delete(files[i]); // Remove the temp file
+ var test = (WLANProfile?)serializer.Deserialize(streamReader);
+ if (test != null)
+ {
+ WiFiItemDisplayer.Children.Add(new WiFiInfoItem(test));
}
- Directory.Delete(path); // Delete the temp directory
+ streamReader.Close();
}
- catch (Exception ex)
+
+ if (WiFiItemDisplayer.Children.Count == 0)
{
- MessageBox.Show(ex.Message, Properties.Resources.Error, MessageBoxButton.OK, MessageBoxImage.Error);
+ PlaceholderGrid.Visibility = Visibility.Visible;
+ Placeholder.Visibility = Visibility.Visible;
+ }
+ else
+ {
+ PlaceholderGrid.Visibility = Visibility.Collapsed;
+ Placeholder.Visibility = Visibility.Collapsed;
}
}
diff --git a/InternetTest/InternetTest/Properties/Resources.Designer.cs b/InternetTest/InternetTest/Properties/Resources.Designer.cs
index 70b9a528..5ef17e0f 100644
--- a/InternetTest/InternetTest/Properties/Resources.Designer.cs
+++ b/InternetTest/InternetTest/Properties/Resources.Designer.cs
@@ -69,6 +69,15 @@ public static string Adapters {
}
}
+ ///
+ /// Looks up a localized string similar to Add site.
+ ///
+ public static string AddSite {
+ get {
+ return ResourceManager.GetString("AddSite", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Ad-hoc network.
///
@@ -213,6 +222,15 @@ public static string Channel {
}
}
+ ///
+ /// Looks up a localized string similar to Checking.
+ ///
+ public static string Checking {
+ get {
+ return ResourceManager.GetString("Checking", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Check for updates.
///
@@ -240,6 +258,15 @@ public static string City {
}
}
+ ///
+ /// Looks up a localized string similar to Close.
+ ///
+ public static string Close {
+ get {
+ return ResourceManager.GetString("Close", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Commands.
///
@@ -411,6 +438,15 @@ public static string DefaultTheme {
}
}
+ ///
+ /// Looks up a localized string similar to Default time interval.
+ ///
+ public static string DefaultTimeInterval {
+ get {
+ return ResourceManager.GetString("DefaultTimeInterval", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Details.
///
@@ -483,6 +519,15 @@ public static string DNSInfo {
}
}
+ ///
+ /// Looks up a localized string similar to DNS Information will show here.
+ ///
+ public static string DnsInfoWillShowHere {
+ get {
+ return ResourceManager.GetString("DnsInfoWillShowHere", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to DNS Suffix.
///
@@ -531,7 +576,7 @@ public static string DownDetectorInfo {
}
///
- /// Looks up a localized string similar to Launch a test to see if a website is available or not.
+ /// Looks up a localized string similar to Add a website to check if it is available or not.
///
public static string DownDetectorPlaceHolder {
get {
@@ -539,6 +584,15 @@ public static string DownDetectorPlaceHolder {
}
}
+ ///
+ /// Looks up a localized string similar to Settings for the DownDetector feature..
+ ///
+ public static string DownDetectorSettingsDesc {
+ get {
+ return ResourceManager.GetString("DownDetectorSettingsDesc", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Empty History.
///
@@ -549,7 +603,7 @@ public static string EmptyHistory {
}
///
- /// Looks up a localized string similar to Are you sure want to empty this history?
+ /// Looks up a localized string similar to Are you sure you want to empty this history?
///This action is irreversible..
///
public static string EmptyHistoryMsg {
@@ -576,6 +630,24 @@ public static string EnterIP {
}
}
+ ///
+ /// Looks up a localized string similar to Erase cached WiFi data.
+ ///
+ public static string EraseWiFiPasswordsFiles {
+ get {
+ return ResourceManager.GetString("EraseWiFiPasswordsFiles", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Are you sure you want to erase cached WiFi Passwords?.
+ ///
+ public static string EraseWiFiPasswordsFilesMsg {
+ get {
+ return ResourceManager.GetString("EraseWiFiPasswordsFilesMsg", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Error.
///
@@ -585,6 +657,15 @@ public static string Error {
}
}
+ ///
+ /// Looks up a localized string similar to Ethernet.
+ ///
+ public static string Ethernet {
+ get {
+ return ResourceManager.GetString("Ethernet", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Execute a trace route.
///
@@ -765,6 +846,15 @@ public static string Hi {
}
}
+ ///
+ /// Looks up a localized string similar to Hide disabled adapters by default.
+ ///
+ public static string HideDisabledAdaptersByDefault {
+ get {
+ return ResourceManager.GetString("HideDisabledAdaptersByDefault", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to History.
///
@@ -801,6 +891,15 @@ public static string HopsLower {
}
}
+ ///
+ /// Looks up a localized string similar to Hover to reveal.
+ ///
+ public static string HoverToReveal {
+ get {
+ return ResourceManager.GetString("HoverToReveal", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to HTTP.
///
@@ -955,6 +1054,15 @@ public static string InvalidDateMsg {
}
}
+ ///
+ /// Looks up a localized string similar to Please provide a valid URL..
+ ///
+ public static string InvalidURLMsg {
+ get {
+ return ResourceManager.GetString("InvalidURLMsg", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to IP Address.
///
@@ -1291,6 +1399,33 @@ public static string NeedRestartToApplyChanges {
}
}
+ ///
+ /// Looks up a localized string similar to Network.
+ ///
+ public static string Network {
+ get {
+ return ResourceManager.GetString("Network", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Network Adapters.
+ ///
+ public static string NetworkAdapters {
+ get {
+ return ResourceManager.GetString("NetworkAdapters", resourceCulture);
+ }
+ }
+
+ ///
+ /// Looks up a localized string similar to Settings to apply to the network adapters section..
+ ///
+ public static string NetworkAdaptersSettingsDesc {
+ get {
+ return ResourceManager.GetString("NetworkAdaptersSettingsDesc", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Next.
///
@@ -1354,6 +1489,15 @@ public static string NotConnected {
}
}
+ ///
+ /// Looks up a localized string similar to Offline.
+ ///
+ public static string NotConnectedS {
+ get {
+ return ResourceManager.GetString("NotConnectedS", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to No thanks.
///
@@ -1561,6 +1705,15 @@ public static string Pinned {
}
}
+ ///
+ /// Looks up a localized string similar to Automatic updates are not available in portable mode, please download InternetTest Pro (Portable) again..
+ ///
+ public static string PortableNoAutoUpdates {
+ get {
+ return ResourceManager.GetString("PortableNoAutoUpdates", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Pro.
///
@@ -1579,6 +1732,15 @@ public static string ProfileName {
}
}
+ ///
+ /// Looks up a localized string similar to Quick actions.
+ ///
+ public static string QuickActions {
+ get {
+ return ResourceManager.GetString("QuickActions", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Receive Only.
///
@@ -1969,6 +2131,15 @@ public static string Test {
}
}
+ ///
+ /// Looks up a localized string similar to Test all.
+ ///
+ public static string TestAll {
+ get {
+ return ResourceManager.GetString("TestAll", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Test your connection.
///
@@ -2041,6 +2212,15 @@ public static string TimeElapsed {
}
}
+ ///
+ /// Looks up a localized string similar to Automatically launch tests to check whether a website is down or not..
+ ///
+ public static string TimerDesc {
+ get {
+ return ResourceManager.GetString("TimerDesc", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Timezone.
///
@@ -2185,6 +2365,15 @@ public static string Units {
}
}
+ ///
+ /// Looks up a localized string similar to Unknown.
+ ///
+ public static string Unknown {
+ get {
+ return ResourceManager.GetString("Unknown", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Updates.
///
diff --git a/InternetTest/InternetTest/Properties/Resources.en-US.resx b/InternetTest/InternetTest/Properties/Resources.en-US.resx
index 12fe3339..8a577ee3 100644
--- a/InternetTest/InternetTest/Properties/Resources.en-US.resx
+++ b/InternetTest/InternetTest/Properties/Resources.en-US.resx
@@ -250,7 +250,7 @@
Test website
- Launch a test to see if a website is available or not
+ Add a website to check if it is available or not
Map provider
@@ -421,7 +421,7 @@
Empty History
- Are you sure want to empty this history?
+ Are you sure you want to empty this history?
This action is irreversible.
@@ -894,4 +894,67 @@ Absolutely NO data is sent to Léo Corporation.
Copy
+
+ Offline
+
+
+ Checking
+
+
+ Network
+
+
+ Hover to reveal
+
+
+ Close
+
+
+ Quick actions
+
+
+ DNS Information will show here
+
+
+ Add site
+
+
+ Automatically launch tests to check whether a website is down or not.
+
+
+ Test all
+
+
+ Erase cached WiFi data
+
+
+ Are you sure you want to erase cached WiFi Passwords?
+
+
+ Ethernet
+
+
+ Please provide a valid URL.
+
+
+ Unknown
+
+
+ Default time interval
+
+
+ Settings for the DownDetector feature.
+
+
+ Network Adapters
+
+
+ Settings to apply to the network adapters section.
+
+
+ Hide disabled adapters by default
+
+
+ Automatic updates are not available in portable mode, please download InternetTest Pro (Portable) again.
+
\ No newline at end of file
diff --git a/InternetTest/InternetTest/Properties/Resources.fr-FR.resx b/InternetTest/InternetTest/Properties/Resources.fr-FR.resx
index 8157ef86..45ad41d3 100644
--- a/InternetTest/InternetTest/Properties/Resources.fr-FR.resx
+++ b/InternetTest/InternetTest/Properties/Resources.fr-FR.resx
@@ -250,7 +250,7 @@
Tester un site
- Lancez un test pour voir si un site est disponible ou non
+ Ajoutez un site web pour vérifier s'il est disponible ou non
Fournisseur de carte
@@ -894,4 +894,67 @@ Absolument AUCUNE donnée n'est envoyée à Léo Corporation.
Copier
+
+ Déconnecté
+
+
+ Vérification
+
+
+ Réseau
+
+
+ Survoler pour réveler
+
+
+ Fermer
+
+
+ Actions rapides
+
+
+ Les informations sur le DNS s'afficheront ici
+
+
+ Ajouter un site
+
+
+ Lancer automatiquement des tests pour vérifier si un site web est en down ou non.
+
+
+ Tout tester
+
+
+ Effacer les données WiFi mises en cache
+
+
+ Êtes-vous sûr de vouloir effacer les mots de passe WiFi mis en cache ?
+
+
+ Ethernet
+
+
+ Veuillez spécifier une URL valide.
+
+
+ Inconnu
+
+
+ Intervalle de temps par défaut
+
+
+ Paramètres de la fonction DownDetector.
+
+
+ Adaptateurs réseau
+
+
+ Paramètres à appliquer à la section des adaptateurs réseau.
+
+
+ Masquer les adaptateurs désactivés par défaut
+
+
+ Les mises à jour automatiques ne sont pas disponibles en mode portable, veuillez télécharger InternetTest Pro (Portable) à nouveau.
+
\ No newline at end of file
diff --git a/InternetTest/InternetTest/Properties/Resources.it-IT.resx b/InternetTest/InternetTest/Properties/Resources.it-IT.resx
index a5c8f61b..4418071b 100644
--- a/InternetTest/InternetTest/Properties/Resources.it-IT.resx
+++ b/InternetTest/InternetTest/Properties/Resources.it-IT.resx
@@ -250,7 +250,7 @@
Test sito web
- Esegui un test per verificare se un sito web è disponibile o meno
+ Aggiungere un sito web per verificare se è disponibile o meno
Fornitore mappe
@@ -819,10 +819,10 @@ Assolutamente NESSUN dato verrà inviato a Léo Corporation.
Schede di rete
-
+
Tipo interfaccia
-
+
Totale byte inviati
@@ -894,4 +894,67 @@ Assolutamente NESSUN dato verrà inviato a Léo Corporation.
Copia
+
+ Non in linea
+
+
+ Controllo
+
+
+ Rete
+
+
+ Passare il mouse per rivelare
+
+
+ Chiudere
+
+
+ Azioni rapide
+
+
+ Le informazioni DNS vengono visualizzate qui
+
+
+ Aggiungi sito
+
+
+ Lancio automatico di test per verificare se un sito web è inattivo o meno.
+
+
+ Test di tutti
+
+
+ Cancellare i dati WiFi memorizzati nella cache
+
+
+ Siete sicuri di voler cancellare le password WiFi memorizzate nella cache?
+
+
+ Ethernet
+
+
+ Si prega di fornire un URL valido.
+
+
+ Sconosciuto
+
+
+ Intervallo di tempo predefinito
+
+
+ Impostazioni per la funzione DownDetector.
+
+
+ Adattatori di rete
+
+
+ Impostazioni da applicare alla sezione degli adattatori di rete.
+
+
+ Nascondere gli adattatori disabilitati per impostazione predefinita
+
+
+ Gli aggiornamenti automatici non sono disponibili in modalità portatile; scaricare nuovamente InternetTest Pro (Portable).
+
\ No newline at end of file
diff --git a/InternetTest/InternetTest/Properties/Resources.resx b/InternetTest/InternetTest/Properties/Resources.resx
index 869a9fb9..56525fd4 100644
--- a/InternetTest/InternetTest/Properties/Resources.resx
+++ b/InternetTest/InternetTest/Properties/Resources.resx
@@ -250,7 +250,7 @@
Test website
- Launch a test to see if a website is available or not
+ Add a website to check if it is available or not
Map provider
@@ -421,7 +421,7 @@
Empty History
- Are you sure want to empty this history?
+ Are you sure you want to empty this history?
This action is irreversible.
@@ -894,4 +894,67 @@ Absolutely NO data is sent to Léo Corporation.
Copy
+
+ Offline
+
+
+ Checking
+
+
+ Network
+
+
+ Hover to reveal
+
+
+ Close
+
+
+ Quick actions
+
+
+ DNS Information will show here
+
+
+ Add site
+
+
+ Automatically launch tests to check whether a website is down or not.
+
+
+ Test all
+
+
+ Erase cached WiFi data
+
+
+ Are you sure you want to erase cached WiFi Passwords?
+
+
+ Ethernet
+
+
+ Please provide a valid URL.
+
+
+ Unknown
+
+
+ Default time interval
+
+
+ Settings for the DownDetector feature.
+
+
+ Network Adapters
+
+
+ Settings to apply to the network adapters section.
+
+
+ Hide disabled adapters by default
+
+
+ Automatic updates are not available in portable mode, please download InternetTest Pro (Portable) again.
+
\ No newline at end of file
diff --git a/InternetTest/InternetTest/Properties/Resources.zh-CN.resx b/InternetTest/InternetTest/Properties/Resources.zh-CN.resx
index 8ebf09f7..a3765176 100644
--- a/InternetTest/InternetTest/Properties/Resources.zh-CN.resx
+++ b/InternetTest/InternetTest/Properties/Resources.zh-CN.resx
@@ -250,7 +250,7 @@
测试网站
- 启动测试以查看网站是否可用
+ 添加网站以检查是否可用
地图提供者
@@ -885,4 +885,67 @@
复制
+
+ 离线
+
+
+ 检查
+
+
+ 网络
+
+
+ 悬停显示
+
+
+ 关闭
+
+
+ 快速行动
+
+
+ 此处将显示 DNS 信息
+
+
+ 添加站点
+
+
+ 自动启动测试,检查网站是否瘫痪。
+
+
+ 全部测试
+
+
+ 清除缓存的 WiFi 数据
+
+
+ 您确定要删除缓存的 WiFi 密码吗?
+
+
+ 以太网
+
+
+ 请提供有效的 URL。
+
+
+ 不明
+
+
+ 默认时间间隔
+
+
+ DownDetector 功能的设置。
+
+
+ 网络适配器
+
+
+ 应用于网络适配器部分的设置。
+
+
+ 默认隐藏已禁用的适配器
+
+
+ 自动更新在便携模式下不可用,请重新下载 InternetTest Pro (便携版)。
+
\ No newline at end of file
diff --git a/InternetTest/InternetTest/Themes/Dark.xaml b/InternetTest/InternetTest/Themes/Dark.xaml
index 9a92ae9f..48c018df 100644
--- a/InternetTest/InternetTest/Themes/Dark.xaml
+++ b/InternetTest/InternetTest/Themes/Dark.xaml
@@ -1,24 +1,52 @@
-
- #0A0A1E
- #141428
- #141446
- #FFFFFF
- /Images/DarkBackground.png
- #141428
- #1E1E32
- #ffffff
- #2153E0
- #7998ec
- #001A65
- #5A5A6E
- #25DE0F
- #FF321E
- #ff7a00
- #7474B1
+ xmlns:local="clr-namespace:InternetTest.Themes">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/InternetTest/InternetTest/Themes/Light.xaml b/InternetTest/InternetTest/Themes/Light.xaml
index a88c30ee..160b8bff 100644
--- a/InternetTest/InternetTest/Themes/Light.xaml
+++ b/InternetTest/InternetTest/Themes/Light.xaml
@@ -1,24 +1,53 @@
+ xmlns:local="clr-namespace:InternetTest.Themes">
- #ffffff
- #e6e6e6
- #ffffff
- #000000
- /Images/LightBackground.png
- #E5E5E5
- #DBDBDB
- #ffffff
- #2153E0
- #2153E0
- #CAD8FF
- #DEDEDE
- #25DE0F
- #FF321E
- #ff7a00
- #969696
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/InternetTest/InternetTest/UserControls/ActionCard.xaml b/InternetTest/InternetTest/UserControls/ActionCard.xaml
deleted file mode 100644
index 74a0d840..00000000
--- a/InternetTest/InternetTest/UserControls/ActionCard.xaml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/InternetTest/InternetTest/UserControls/ActionCard.xaml.cs b/InternetTest/InternetTest/UserControls/ActionCard.xaml.cs
deleted file mode 100644
index ec2314ab..00000000
--- a/InternetTest/InternetTest/UserControls/ActionCard.xaml.cs
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
-MIT License
-
-Copyright (c) Léo Corporation
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
-using InternetTest.Classes;
-using InternetTest.Enums;
-using System;
-using System.Windows.Controls;
-
-namespace InternetTest.UserControls;
-///
-/// Interaction logic for ActionCard.xaml
-///
-public partial class ActionCard : UserControl
-{
- AppActions AppAction { get; init; }
- public ActionCard(AppActions appActions)
- {
- InitializeComponent();
- AppAction = appActions; // Set value
-
- InitUI(); // Load the UI
- }
-
- private void InitUI()
- {
- IconTxt.Text = Global.ActionsIcons[AppAction]; // Set text
- PageNameTxt.Text = Global.ActionsString[AppAction]; // Set text
- }
- public static event EventHandler OnCardClick;
-
- private void Border_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
- {
- switch (AppAction)
- {
- case AppActions.Test:
- Global.StatusPage.TestBtn_Click(this, null);
- OnCardClick?.Invoke(this, new(AppPages.Status));
- break;
- case AppActions.DownDetectorRequest:
- Global.DownDetectorPage.TestBtn_Click(this, null);
- OnCardClick?.Invoke(this, new(AppPages.DownDetector));
- break;
- case AppActions.MyIP:
- Global.MyIpPage.GetMyIPBtn_Click(this, null);
- OnCardClick?.Invoke(this, new(AppPages.MyIP));
- break;
- case AppActions.LocateIP:
- Global.LocateIpPage.LocateIPBtn_Click(this, null);
- OnCardClick?.Invoke(this, new(AppPages.LocateIP));
- break;
- case AppActions.Ping:
- Global.PingPage.IpTxt.Text = Global.PingPage.IpTxt.Text == ""
- ? Global.Settings.TestSite ?? "https://leocorporation.dev"
- : Global.PingPage.IpTxt.Text;
- Global.PingPage.PingBtn_Click(this, null);
- OnCardClick?.Invoke(this, new(AppPages.Ping));
- break;
- case AppActions.GetWiFiPasswords:
- Global.WiFiPasswordsPage.GetWiFiBtn_Click(this, null);
- OnCardClick?.Invoke(this, new(AppPages.WiFiPasswords));
- break;
- case AppActions.GetIPConfig:
- Global.IpConfigPage.RefreshBtn_Click(this, null);
- OnCardClick?.Invoke(this, new(AppPages.IPConfig));
- break;
- case AppActions.GetDnsInfo:
- Global.DnsPage.SiteTxt.Text = string.IsNullOrEmpty(Global.DnsPage.SiteTxt.Text) ? Global.Settings.TestSite.Replace("https://", "").Replace("http://","") : Global.DnsPage.SiteTxt.Text;
- Global.DnsPage.GetDnsInfoBtn_Click(this, null);
- OnCardClick?.Invoke(this, new(AppPages.DnsTool));
- break;
- case AppActions.TraceRoute:
-
- OnCardClick?.Invoke(this, new(AppPages.TraceRoute));
- break;
- case AppActions.ConnectWiFi:
-
- OnCardClick?.Invoke(this, new(AppPages.WiFiNetworks));
- break;
- default:
- break;
- }
- }
-}
diff --git a/InternetTest/InternetTest/UserControls/AdapterItem.xaml b/InternetTest/InternetTest/UserControls/AdapterItem.xaml
index c212448b..5256b645 100644
--- a/InternetTest/InternetTest/UserControls/AdapterItem.xaml
+++ b/InternetTest/InternetTest/UserControls/AdapterItem.xaml
@@ -9,19 +9,19 @@
Width="350"
Height="170"
FontFamily="..\Fonts\#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
+ Color="{DynamicResource AccentColor}" />
@@ -41,7 +41,7 @@
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="16"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Text="" />
diff --git a/InternetTest/InternetTest/UserControls/AdapterItem.xaml.cs b/InternetTest/InternetTest/UserControls/AdapterItem.xaml.cs
index 91963225..cf2969da 100644
--- a/InternetTest/InternetTest/UserControls/AdapterItem.xaml.cs
+++ b/InternetTest/InternetTest/UserControls/AdapterItem.xaml.cs
@@ -24,21 +24,9 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using InternetTest.Classes;
using InternetTest.Windows;
-using System;
-using System.Collections.Generic;
-using System.Linq;
using System.Net.NetworkInformation;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
namespace InternetTest.UserControls
{
diff --git a/InternetTest/InternetTest/UserControls/DnsRecordItem.xaml b/InternetTest/InternetTest/UserControls/DnsRecordItem.xaml
index 6bdd7c5d..05eca6dc 100644
--- a/InternetTest/InternetTest/UserControls/DnsRecordItem.xaml
+++ b/InternetTest/InternetTest/UserControls/DnsRecordItem.xaml
@@ -6,19 +6,19 @@
xmlns:local="clr-namespace:InternetTest.UserControls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
+ Color="{DynamicResource AccentColor}" />
@@ -47,7 +47,7 @@
Click="CopyBtn_Click"
Content=""
FontFamily="../Fonts/#FluentSystemIcons-Regular"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
Style="{DynamicResource DefaultButton}" />
diff --git a/InternetTest/InternetTest/UserControls/DownDetectorItem.xaml b/InternetTest/InternetTest/UserControls/DownDetectorItem.xaml
deleted file mode 100644
index 78d88bbb..00000000
--- a/InternetTest/InternetTest/UserControls/DownDetectorItem.xaml
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/InternetTest/InternetTest/UserControls/DownDetectorItem.xaml.cs b/InternetTest/InternetTest/UserControls/DownDetectorItem.xaml.cs
deleted file mode 100644
index 2af2cc10..00000000
--- a/InternetTest/InternetTest/UserControls/DownDetectorItem.xaml.cs
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
-MIT License
-
-Copyright (c) Léo Corporation
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-*/
-using InternetTest.Classes;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Media;
-
-namespace InternetTest.UserControls;
-///
-/// Interaction logic for DownDetectorItem.xaml
-///
-public partial class DownDetectorItem : UserControl
-{
- bool codeInjected = !Global.Settings.UseSynethia;
- StackPanel ParentStackPanel { get; init; }
- internal DownDetectorTestResult DownDetectorTestResult { get; set; }
- string URL { get; set; }
- public DownDetectorItem(StackPanel parentElement, string url, DownDetectorTestResult downDetectorTestResult)
- {
- InitializeComponent();
- ParentStackPanel = parentElement; // Save the parent element
- URL = url; // Save the URL
- DownDetectorTestResult = downDetectorTestResult; // Save the result
-
- InitUI(); // load the UI
- }
-
- private void InitUI()
- {
- if (codeInjected) return;
- codeInjected = true;
- foreach (Button b in Global.FindVisualChildren(this))
- {
- b.Click += (sender, e) =>
- {
- Global.SynethiaConfig.StatusPageInfo.InteractionCount++;
- };
- }
- // For each TextBox of the page
- foreach (TextBox textBox in Global.FindVisualChildren(this))
- {
- textBox.GotFocus += (o, e) =>
- {
- Global.SynethiaConfig.StatusPageInfo.InteractionCount++;
- };
- }
-
- WebsiteTxt.Text = URL; // Set text
-
- if (DownDetectorTestResult.Code == 0) return;
- UpdateIcon();
-
- }
-
- internal void UpdateIcon()
- {
- if (DownDetectorTestResult.Code >= 400) // If the website is down
- {
- IconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Red")); // Set color to red
- IconTxt.Text = "\uF36E"; // Add (down) to the text
- }
- else // If the website is up
- {
- IconTxt.Foreground = new SolidColorBrush(Global.GetColorFromResource("Green")); // Set color to green
- IconTxt.Text = "\uF299"; // Add (up) to the text
- }
- }
-
- private async void TestSiteBtn_Click(object sender, RoutedEventArgs e)
- {
- if (!WebsiteTxt.Text.StartsWith("http"))
- {
- WebsiteTxt.Text = "https://" + WebsiteTxt.Text;
- }
- DownDetectorTestResult = await Global.DownDetectorPage.LaunchTest(WebsiteTxt.Text); // Launch the test
- URL = WebsiteTxt.Text;
-
- UpdateIcon(); // Update the icon
- }
-
- private void InfoBtn_Click(object sender, RoutedEventArgs e)
- {
- if (DownDetectorTestResult is not null)
- {
- Global.DownDetectorPage.DetailsStatusTxt.Text = DownDetectorTestResult.Code.ToString(); // Set the text
- Global.DownDetectorPage.DetailsTimeTxt.Text = $"{DownDetectorTestResult.Time}ms"; // Set the text
- Global.DownDetectorPage.DetailsMessageTxt.Text = DownDetectorTestResult.Message; // Set the text
- Global.DownDetectorPage.DetailsSiteNameTxt.Text = string.Format(Properties.Resources.OfWebsite, URL); // Set the text
- }
- }
-
- private void DeleteBtn_Click(object sender, RoutedEventArgs e)
- {
- ParentStackPanel.Children.Remove(this); // Delete this element from the parent element
- Global.DownDetectorPage.TotalWebsites--; // Update the total websites
- Global.DownDetectorPage.TestBtn.Content = $"{Properties.Resources.Test} ({Global.DownDetectorPage.TotalWebsites})"; // Update the text
- }
-}
diff --git a/InternetTest/InternetTest/UserControls/IpConfigItem.xaml b/InternetTest/InternetTest/UserControls/IpConfigItem.xaml
index bfc0a51a..31b5caa4 100644
--- a/InternetTest/InternetTest/UserControls/IpConfigItem.xaml
+++ b/InternetTest/InternetTest/UserControls/IpConfigItem.xaml
@@ -9,19 +9,19 @@
Height="Auto"
d:DesignWidth="800"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
+ Color="{DynamicResource AccentColor}" />
@@ -49,7 +49,7 @@
Click="CopyBtn_Click"
Content=""
FontFamily="../Fonts/#FluentSystemIcons-Regular"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
Style="{DynamicResource DefaultButton}" />
diff --git a/InternetTest/InternetTest/UserControls/IpConfigItem.xaml.cs b/InternetTest/InternetTest/UserControls/IpConfigItem.xaml.cs
index 3f273757..5ab2b7d7 100644
--- a/InternetTest/InternetTest/UserControls/IpConfigItem.xaml.cs
+++ b/InternetTest/InternetTest/UserControls/IpConfigItem.xaml.cs
@@ -81,7 +81,7 @@ internal void InitUI()
{
b.Click += (sender, e) =>
{
- Global.SynethiaConfig.StatusPageInfo.InteractionCount++;
+ Global.SynethiaConfig.PagesInfo[4].InteractionCount++;
};
}
}
diff --git a/InternetTest/InternetTest/UserControls/PageCard.xaml b/InternetTest/InternetTest/UserControls/PageCard.xaml
index 37c37dc5..9dbc396c 100644
--- a/InternetTest/InternetTest/UserControls/PageCard.xaml
+++ b/InternetTest/InternetTest/UserControls/PageCard.xaml
@@ -5,16 +5,18 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:InternetTest.UserControls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- Height="75"
- MinWidth="200"
+ Height="65"
+ MinWidth="220"
Margin="5"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
@@ -23,26 +25,69 @@
Direction="270"
Opacity="0.1"
ShadowDepth="0"
- Color="#1F1F1F" />
+ Color="{DynamicResource AccentColor}" />
-
-
+
+
+
+
+
-
-
+ Orientation="Horizontal">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/InternetTest/InternetTest/UserControls/Placeholder.xaml b/InternetTest/InternetTest/UserControls/Placeholder.xaml
index df9c93a3..09bb2da0 100644
--- a/InternetTest/InternetTest/UserControls/Placeholder.xaml
+++ b/InternetTest/InternetTest/UserControls/Placeholder.xaml
@@ -11,7 +11,7 @@
d:DesignHeight="450"
d:DesignWidth="800"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource DarkGray}}"
+ Foreground="{DynamicResource DarkGray}"
mc:Ignorable="d">
+ Color="{DynamicResource AccentColor}" />
@@ -51,7 +51,7 @@
Click="DeleteBtn_Click"
Content=""
FontFamily="../Fonts/#FluentSystemIcons-Regular"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
Style="{DynamicResource ToolButton}" />
diff --git a/InternetTest/InternetTest/UserControls/StatusHistoryItem.xaml.cs b/InternetTest/InternetTest/UserControls/StatusHistoryItem.xaml.cs
index 61eda7d5..be392a3b 100644
--- a/InternetTest/InternetTest/UserControls/StatusHistoryItem.xaml.cs
+++ b/InternetTest/InternetTest/UserControls/StatusHistoryItem.xaml.cs
@@ -26,7 +26,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using PeyrSharp.Core.Converters;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
namespace InternetTest.UserControls;
///
@@ -56,9 +55,9 @@ private void InitUI()
IconTxt.Foreground = IconTxt.Text switch
{
- "\uF299" => new SolidColorBrush { Color = Global.GetColorFromResource("Green") },
- "\uF36E" => new SolidColorBrush { Color = Global.GetColorFromResource("Red") },
- _ => new SolidColorBrush { Color = Global.GetColorFromResource("Gray") }
+ "\uF299" => Global.GetBrushFromResource("Green"),
+ "\uF36E" => Global.GetBrushFromResource("Red"),
+ _ => Global.GetBrushFromResource("Gray")
};
}
diff --git a/InternetTest/InternetTest/UserControls/TraceRouteItem.xaml b/InternetTest/InternetTest/UserControls/TraceRouteItem.xaml
index 7f6d5723..7aa77bcb 100644
--- a/InternetTest/InternetTest/UserControls/TraceRouteItem.xaml
+++ b/InternetTest/InternetTest/UserControls/TraceRouteItem.xaml
@@ -15,7 +15,7 @@
Margin="5"
Padding="5"
VerticalAlignment="Top"
- Background="{Binding Source={StaticResource CardBackground}}"
+ Background="{DynamicResource CardBackground}"
CornerRadius="5">
+ Foreground="{DynamicResource DarkGray}" />
@@ -90,15 +90,15 @@
Margin="0 0 0 -3"
VerticalAlignment="Bottom"
Panel.ZIndex="1"
- Fill="{Binding Source={StaticResource Background1}}"
- Stroke="{Binding Source={StaticResource AccentColor}}"
+ Fill="{DynamicResource Background1}"
+ Stroke="{DynamicResource Accent}"
StrokeDashOffset="1"
StrokeThickness="1" />
diff --git a/InternetTest/InternetTest/UserControls/TraceRouteItem.xaml.cs b/InternetTest/InternetTest/UserControls/TraceRouteItem.xaml.cs
index 56da7f33..edf7a6dc 100644
--- a/InternetTest/InternetTest/UserControls/TraceRouteItem.xaml.cs
+++ b/InternetTest/InternetTest/UserControls/TraceRouteItem.xaml.cs
@@ -26,7 +26,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using System.Net.NetworkInformation;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Media;
namespace InternetTest.UserControls;
///
@@ -57,9 +56,9 @@ void InitUI()
};
IconTxt.Foreground = TracertStep.Status switch
{
- IPStatus.Success => new SolidColorBrush { Color = Global.GetColorFromResource("Green") },
- IPStatus.TtlExpired => new SolidColorBrush { Color = Global.GetColorFromResource("Green") },
- _ => new SolidColorBrush { Color = Global.GetColorFromResource("Red") }
+ IPStatus.Success => Global.GetBrushFromResource("Green"),
+ IPStatus.TtlExpired => Global.GetBrushFromResource("Green"),
+ _ => Global.GetBrushFromResource("Red")
};
if (TracertStep.Status == IPStatus.TimedOut)
diff --git a/InternetTest/InternetTest/UserControls/WebsiteItem.xaml b/InternetTest/InternetTest/UserControls/WebsiteItem.xaml
new file mode 100644
index 00000000..5e617964
--- /dev/null
+++ b/InternetTest/InternetTest/UserControls/WebsiteItem.xaml
@@ -0,0 +1,151 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/InternetTest/InternetTest/UserControls/WebsiteItem.xaml.cs b/InternetTest/InternetTest/UserControls/WebsiteItem.xaml.cs
new file mode 100644
index 00000000..52691d49
--- /dev/null
+++ b/InternetTest/InternetTest/UserControls/WebsiteItem.xaml.cs
@@ -0,0 +1,125 @@
+/*
+MIT License
+
+Copyright (c) Léo Corporation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+*/
+
+using InternetTest.Classes;
+using PeyrSharp.Core;
+using PeyrSharp.Core.Converters;
+using System;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Threading;
+
+namespace InternetTest.UserControls;
+
+public partial class WebsiteItem : UserControl
+{
+ public string URL { get; }
+
+ public WebsiteItem(string url)
+ {
+ InitializeComponent();
+ URL = url;
+
+ InitUI();
+ }
+
+ private void InitUI()
+ {
+ WebsiteNameTxt.Text = URL;
+ }
+
+ private void TestBtn_Click(object sender, RoutedEventArgs e)
+ {
+ LaunchTestAsync();
+ }
+
+ private void ExpanderBtn_Click(object sender, RoutedEventArgs e)
+ {
+ CollapseGrid.Visibility = CollapseGrid.Visibility == Visibility.Visible ? Visibility.Collapsed : Visibility.Visible;
+ ExpanderBtn.Content = CollapseGrid.Visibility != Visibility.Visible ? "\uF2A4" : "\uF2B7";
+ }
+
+ internal async void LaunchTestAsync()
+ {
+ try
+ {
+ // Loading UI
+ StatusIcon.Text = "\uF2DE";
+ StatusIcon.Foreground = Global.GetBrushFromResource("Accent");
+
+ // Chronometer
+ int time = 0;
+ DispatcherTimer dispatcherTimer = new() { Interval = TimeSpan.FromMilliseconds(1) };
+ dispatcherTimer.Tick += (o, e) => time++;
+
+ dispatcherTimer.Start();
+ var statusInfo = await Internet.GetStatusInfoAsync(URL); // Makes a request to the specified website and saves the status code and message
+ dispatcherTimer.Stop();
+
+ // Load Information
+ TimeTxt.Text = $"{time}ms";
+ StatusCodeTxt.Text = statusInfo.StatusCode.ToString();
+ StatusCodeBisTxt.Text = statusInfo.StatusCode.ToString();
+ StatusMsgTxt.Text = statusInfo.StatusDescription;
+ StatusIcon.Text = statusInfo.StatusCode switch
+ {
+ >= 400 => "\uF36E",
+ >= 300 => "\uF4AB",
+ _ => "\uF299",
+ };
+ StatusIcon.Foreground = statusInfo.StatusCode switch
+ {
+ >= 400 => Global.GetBrushFromResource("Red"),
+ >= 300 => Global.GetBrushFromResource("Accent"),
+ _ => Global.GetBrushFromResource("Green"),
+ };
+
+ StatusSection.Visibility = Visibility.Visible;
+
+ // Save the test to the history
+ Global.History.DownDetectorHistory.Add(new(Time.DateTimeToUnixTime(DateTime.Now), StatusIcon.Text, statusInfo.StatusCode, statusInfo.StatusDescription, URL));
+ }
+ catch (Exception ex)
+ {
+ StatusSection.Visibility = Visibility.Visible;
+ StatusIcon.Text = "\uF36E";
+ StatusIcon.Foreground = Global.GetBrushFromResource("Red");
+ StatusCodeTxt.Text = "4xx";
+ StatusCodeBisTxt.Text = "4xx";
+ StatusMsgTxt.Text = ex.Message;
+ }
+ }
+
+ private void DeleteBtn_Click(object sender, RoutedEventArgs e)
+ {
+#pragma warning disable CS8602 // DownDetectorPage cannot be null in this context
+ Global.DownDetectorPage.WebsiteDisplayer.Children.Remove(this);
+ Global.DownDetectorPage.Websites.Remove(URL);
+ Global.DownDetectorPage.Placeholder.Visibility = Global.DownDetectorPage.WebsiteDisplayer.Children.Count == 0 ? Visibility.Visible : Visibility.Collapsed;
+#pragma warning restore CS8602
+
+ Global.Settings.DownDetectorWebsites = Global.DownDetectorPage.Websites;
+ SettingsManager.Save();
+ }
+}
diff --git a/InternetTest/InternetTest/UserControls/WiFiInfoItem.xaml b/InternetTest/InternetTest/UserControls/WiFiInfoItem.xaml
index 3f545bb9..01fdf8b6 100644
--- a/InternetTest/InternetTest/UserControls/WiFiInfoItem.xaml
+++ b/InternetTest/InternetTest/UserControls/WiFiInfoItem.xaml
@@ -9,19 +9,19 @@
Height="Auto"
d:DesignWidth="800"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
+ Color="{DynamicResource AccentColor}" />
@@ -49,7 +49,7 @@
Click="CopyBtn_Click"
Content=""
FontFamily="../Fonts/#FluentSystemIcons-Regular"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
Style="{DynamicResource DefaultButton}" />
@@ -118,7 +118,7 @@
Click="ShowKeyBtn_Click"
Content=""
FontFamily="../Fonts/#FluentSystemIcons-Regular"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
Style="{DynamicResource DefaultButton}" />
{
- Global.SynethiaConfig.WiFiPasswordsPageInfo.InteractionCount++;
+ Global.SynethiaConfig.PagesInfo[7].InteractionCount++;
};
}
}
diff --git a/InternetTest/InternetTest/UserControls/WiFiNetworkItem.xaml b/InternetTest/InternetTest/UserControls/WiFiNetworkItem.xaml
index 937431cc..6e82ef25 100644
--- a/InternetTest/InternetTest/UserControls/WiFiNetworkItem.xaml
+++ b/InternetTest/InternetTest/UserControls/WiFiNetworkItem.xaml
@@ -9,19 +9,19 @@
Height="Auto"
d:DesignWidth="800"
FontFamily="../Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
mc:Ignorable="d">
+ Color="{DynamicResource AccentColor}" />
@@ -55,12 +55,12 @@
Margin="0 0 5 0"
Padding="5 2"
HorizontalAlignment="Right"
- Background="{Binding Source={StaticResource LightAccentColor}}"
+ Background="{DynamicResource LightAccent}"
Click="ConnectBtn_Click"
Content="{x:Static lang:Resources.Connect}"
Cursor="Hand"
FontWeight="ExtraBold"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Style="{DynamicResource PrimaryButton}" />
@@ -95,14 +95,14 @@
+ Color="{DynamicResource AccentColor}" />
@@ -116,21 +116,21 @@
Margin="10 3 10 3"
Padding="3"
VerticalAlignment="Center"
- Background="{Binding Source={StaticResource CardBackground}}"
+ Background="{DynamicResource CardBackground}"
CornerRadius="5">
+ Color="{DynamicResource AccentColor}" />
+ Foreground="{DynamicResource Foreground1}" />
diff --git a/InternetTest/InternetTest/UserControls/WiFiNetworkItem.xaml.cs b/InternetTest/InternetTest/UserControls/WiFiNetworkItem.xaml.cs
index e3f85c49..66d573d5 100644
--- a/InternetTest/InternetTest/UserControls/WiFiNetworkItem.xaml.cs
+++ b/InternetTest/InternetTest/UserControls/WiFiNetworkItem.xaml.cs
@@ -24,21 +24,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using InternetTest.Classes;
using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Runtime.Intrinsics.X86;
-using System.Text;
-using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-using static System.Net.Mime.MediaTypeNames;
namespace InternetTest.UserControls;
///
@@ -72,7 +59,7 @@ int n when (n >= 75 && n <= 100) => "\uF8AD",
ProfileTxt.Text = NetworkInfo.ProfileName;
InterfaceTxt.Text = NetworkInfo.InterfaceDescription;
BSSTxt.Text = NetworkInfo.BssType;
- SecurityEnabledTxt.Text = NetworkInfo.IsSecurityEnabled ? Properties.Resources.Yes : Properties.Resources.No ;
+ SecurityEnabledTxt.Text = NetworkInfo.IsSecurityEnabled ? Properties.Resources.Yes : Properties.Resources.No;
ChannelTxt.Text = $"{NetworkInfo.Channel}";
BandTxt.Text = $"{NetworkInfo.Band:0.0} GHz";
FrequencyTxt.Text = $"{NetworkInfo.Frequency} kHz";
@@ -91,9 +78,6 @@ private void ExpanderBtn_Click(object sender, RoutedEventArgs e)
private async void ConnectBtn_Click(object sender, RoutedEventArgs e)
{
- // Increment the interaction count of the ActionInfo in Global.SynethiaConfig
- Global.SynethiaConfig.ActionInfos.First(a => a.Action == Enums.AppActions.ConnectWiFi).UsageCount++;
-
if (!string.IsNullOrEmpty(NetworkInfo.ProfileName))
{
if (await Global.ConnectAsync(NetworkInfo.Ssid, ""))
diff --git a/InternetTest/InternetTest/Windows/AdapterWindow.xaml b/InternetTest/InternetTest/Windows/AdapterWindow.xaml
index e78411e4..cae6e4af 100644
--- a/InternetTest/InternetTest/Windows/AdapterWindow.xaml
+++ b/InternetTest/InternetTest/Windows/AdapterWindow.xaml
@@ -14,7 +14,7 @@
AllowsTransparency="True"
Background="Transparent"
FontFamily="/Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
mc:Ignorable="d">
@@ -52,10 +52,10 @@
-
+
-
+
@@ -113,12 +113,9 @@
-
-
-
@@ -140,7 +137,7 @@
VerticalAlignment="Center"
FontFamily="../Fonts/#FluentSystemIcons-Regular"
FontSize="18"
- Foreground="{Binding Source={StaticResource AccentColor}}"
+ Foreground="{DynamicResource Accent}"
Text="" />
@@ -192,11 +189,11 @@
Padding="5"
HorizontalAlignment="Center"
VerticalAlignment="Center"
- Background="{Binding Source={StaticResource AccentColor}}"
+ Background="{DynamicResource Accent}"
Click="CopyBtn_Click"
Content="{x:Static lang:Resources.Copy}"
FontWeight="Bold"
- Foreground="{Binding Source={StaticResource WindowButtonsHoverForeground1}}"
+ Foreground="{DynamicResource WindowButtonsHoverForeground1}"
Style="{DynamicResource PrimaryButton}" />
diff --git a/InternetTest/InternetTest/Windows/AdapterWindow.xaml.cs b/InternetTest/InternetTest/Windows/AdapterWindow.xaml.cs
index 9b53a737..dec5a887 100644
--- a/InternetTest/InternetTest/Windows/AdapterWindow.xaml.cs
+++ b/InternetTest/InternetTest/Windows/AdapterWindow.xaml.cs
@@ -89,6 +89,6 @@ private void CloseBtn_Click(object sender, RoutedEventArgs e)
private void CopyBtn_Click(object sender, RoutedEventArgs e)
{
Clipboard.SetText(AdapterInfo.ToLongFormattedString());
- }
- }
+ }
+ }
}
diff --git a/InternetTest/InternetTest/Windows/FirstRunWindow.xaml b/InternetTest/InternetTest/Windows/FirstRunWindow.xaml
index 75c22ced..7c69eaad 100644
--- a/InternetTest/InternetTest/Windows/FirstRunWindow.xaml
+++ b/InternetTest/InternetTest/Windows/FirstRunWindow.xaml
@@ -13,7 +13,7 @@
AllowsTransparency="True"
Background="Transparent"
FontFamily="/Fonts/#Hauora"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
ResizeMode="NoResize"
WindowStartupLocation="CenterScreen"
WindowStyle="None"
@@ -52,10 +52,10 @@
-
+
-
+
@@ -130,12 +130,9 @@
-
-
-
@@ -159,7 +156,7 @@
Content=""
FontFamily="/Fonts/#FluentSystemIcons-Regular"
FontSize="14"
- Foreground="{Binding Source={StaticResource Foreground1}}"
+ Foreground="{DynamicResource Foreground1}"
RenderOptions.EdgeMode="Aliased"
Style="{StaticResource TitleBarCloseButtonStyle}" />
diff --git a/InternetTest/Xalyus Updater/Xalyus Updater.csproj b/InternetTest/Xalyus Updater/Xalyus Updater.csproj
index c249b64b..451a9ff1 100644
--- a/InternetTest/Xalyus Updater/Xalyus Updater.csproj
+++ b/InternetTest/Xalyus Updater/Xalyus Updater.csproj
@@ -9,7 +9,7 @@
app.manifest
1.0.0.2208
Léo Corporation
- © 2022
+ © 2024
diff --git a/SETUP_LICENSE b/SETUP_LICENSE
index 4f3cfc18..71fa3352 100644
--- a/SETUP_LICENSE
+++ b/SETUP_LICENSE
@@ -1,9 +1,9 @@
MIT License
-Copyright (c) 2021-2023 Léo Corporation
+Copyright (c) 2021-2024 Léo Corporation
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\ No newline at end of file
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.