Skip to content

Commit

Permalink
Code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Nov 17, 2024
1 parent a31d777 commit 35ac52c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 26 deletions.
2 changes: 1 addition & 1 deletion InternetTest/InternetTest/Classes/DnsCacheInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

using System.Text.Json.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;

namespace InternetTest.Classes;

Expand Down
1 change: 0 additions & 1 deletion InternetTest/InternetTest/Classes/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
using InternetTest.Enums;
using PeyrSharp.Env;
using System;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down
5 changes: 2 additions & 3 deletions InternetTest/InternetTest/Pages/DnsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
using InternetTest.UserControls;
using Microsoft.Win32;
using Synethia;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand Down Expand Up @@ -239,7 +238,7 @@ private void FlushDnsBtn_Click(object sender, RoutedEventArgs e)
if (MessageBox.Show(Properties.Resources.FlushDNSMessage, Properties.Resources.FlushDNS, MessageBoxButton.YesNoCancel, MessageBoxImage.Question) == MessageBoxResult.Yes)
{
ItemDisplayer.Children.Clear();
ProcessStartInfo processInfo = new ProcessStartInfo
ProcessStartInfo processInfo = new()
{
FileName = "ipconfig",
Arguments = "/flushdns",
Expand All @@ -257,6 +256,6 @@ private void FlushDnsBtn_Click(object sender, RoutedEventArgs e)
// Wait for the process to exit
process.WaitForExit();
MessageBox.Show(Properties.Resources.FlushDNSSuccess, Properties.Resources.FlushDNS, MessageBoxButton.OK, MessageBoxImage.Information);
}
}
}
}
9 changes: 1 addition & 8 deletions InternetTest/InternetTest/Pages/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,7 @@ internal async void InitUI()
{
// Load "Get started" section
List<AppPages> relevantPages = Enumerable.Empty<AppPages>().ToList();
if (Global.SynethiaConfig is not null)
{
relevantPages = Global.GetMostRelevantPages(Global.SynethiaConfig);
}
else
{
relevantPages = Global.DefaultRelevantPages;
}
relevantPages = Global.SynethiaConfig is not null ? Global.GetMostRelevantPages(Global.SynethiaConfig) : Global.DefaultRelevantPages;

for (int i = 0; i < 5; i++)
{
Expand Down
2 changes: 1 addition & 1 deletion InternetTest/InternetTest/Pages/LocateIpPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,5 +197,5 @@ private void ResetBtn_Click(object sender, RoutedEventArgs e)
private void MyIPTxt_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
Clipboard.SetText(MyIPTxt.Text);
}
}
}
24 changes: 12 additions & 12 deletions InternetTest/InternetTest/UserControls/DnsCacheItem.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,23 +51,23 @@ private void InitUI()

enum Types
{
A=1,
NS=2,
CNAME=5,
SOA=6,
PTR=12,
MX=15,
TXT=16,
AAAA=28,
A = 1,
NS = 2,
CNAME = 5,
SOA = 6,
PTR = 12,
MX = 15,
TXT = 16,
AAAA = 28,
}

enum Status
{
Success,
NoRecords,
FormatError= 9501,
ServerFailure=9502,
NotExist=9503,
Refused=9505
FormatError = 9501,
ServerFailure = 9502,
NotExist = 9503,
Refused = 9505
}
}

0 comments on commit 35ac52c

Please sign in to comment.