Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
VindEi authored and VindEi committed Jul 27, 2024
1 parent 0f5baa9 commit 68382c9
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 79 deletions.
2 changes: 1 addition & 1 deletion App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using DnsSnap.Function;
using System.Windows;
using System.Security.Principal;
using System.Windows;

namespace DnsSnap
{
Expand Down
7 changes: 1 addition & 6 deletions Core/NavigationService.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using System.Windows.Controls;

namespace DnsSnap.Core
{
Expand Down
13 changes: 3 additions & 10 deletions Function/GetPing.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
using DnsSnap.Pages;
using DnsSnap.Properties;
using System;
using System.Collections.Generic;
using System.Linq;
using DnsSnap.Properties;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace DnsSnap.Function
{
Expand Down Expand Up @@ -37,10 +30,10 @@ public static string ShowPing()
{
done = "Failed (No network connection or invalid server) ";
return done;


}
}
}

}
}
8 changes: 3 additions & 5 deletions Function/Launch.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
using AutoUpdaterDotNET;
using Microsoft.Win32;
using System.Diagnostics;
using System.Reflection;
using System.Security.Principal;
using System.Windows;
using System.Windows.Documents.Serialization;

namespace DnsSnap.Function
{
Expand Down Expand Up @@ -44,7 +42,7 @@ private static void GetAdminAccess()
{
var processInfo = new ProcessStartInfo(AppPath);
processInfo.UseShellExecute = true;

processInfo.Verb = "runas";
try
{
Expand All @@ -57,14 +55,14 @@ private static void GetAdminAccess()
if (res == MessageBoxResult.Yes)
{
Properties.Settings.Default.Admin = "OnConnect";
Properties.Settings.Default.Save();
Properties.Settings.Default.Save();
}

}
Environment.Exit(0);
}
}
public static void CheckForUpdates()
public static void CheckForUpdates()
{
try
{
Expand Down
3 changes: 1 addition & 2 deletions Function/Notifico.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Net;
using System.Windows;
using System.Windows;
using System.Windows.Controls;


Expand Down
2 changes: 0 additions & 2 deletions Function/Notificon.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using DnsSnap.Dns;
using Hardcodet.Wpf.TaskbarNotification;
using System.Collections.ObjectModel;
using System.Net;
using System.Windows;
using System.Windows.Controls;

namespace DnsSnap.Function
{
Expand Down
7 changes: 1 addition & 6 deletions Function/Sound.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Media;
using System.Text;
using System.Threading.Tasks;
using System.Media;

namespace DnsSnap.Function
{
Expand Down
14 changes: 4 additions & 10 deletions Pages/Connect.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
using DnsSnap.Dns;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using DnsSnap.Function;
using DnsSnap.Pages;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Input;
using System.Windows.Controls;
using System.Windows.Input;


namespace DnsSnap.Pages
Expand Down Expand Up @@ -53,11 +47,11 @@ private void GetDnsBtn_MouseDoubleClick(object sender, MouseButtonEventArgs e)
string current;
if (activedns.Length > 1)
{
current = activedns[0] + ","+ activedns[1];
current = activedns[0] + "," + activedns[1];
}
else
{
current =activedns[0];
current = activedns[0];
}
Clipboard.SetText(current);
}
Expand All @@ -78,7 +72,7 @@ private void ConnectBtn_Click(object sender, RoutedEventArgs e)
}
else if (DnsBox.SelectedItem == null)
{
MessageBox.Show("Please Select A Dns","No Dns selected",MessageBoxButton.OK,MessageBoxImage.Exclamation);
MessageBox.Show("Please Select A Dns", "No Dns selected", MessageBoxButton.OK, MessageBoxImage.Exclamation);
}
}
else if (ConnectBtn.Content.ToString() == "Disconnect")
Expand Down
17 changes: 4 additions & 13 deletions Pages/Customize.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
using DnsSnap.Function;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Sockets;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Web;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
Expand All @@ -25,8 +16,8 @@ public partial class Customize : Page
public Customize()
{
InitializeComponent();
FCtxt.Text = Properties.Settings.Default.FirstColor.Replace("#",string.Empty);
SCtxt.Text = Properties.Settings.Default.SecondColor.Replace("#",string.Empty);
FCtxt.Text = Properties.Settings.Default.FirstColor.Replace("#", string.Empty);
SCtxt.Text = Properties.Settings.Default.SecondColor.Replace("#", string.Empty);
TCtxt.Text = Properties.Settings.Default.ThirdColor.Replace("#", string.Empty);
}

Expand Down Expand Up @@ -82,7 +73,7 @@ private void Soon_Click(object sender, RoutedEventArgs e)
}
private void RR()
{
string url ="https://youtu.be/dQw4w9WgXcQ?si=jok1rrhkt2JvBz4F";
string url = "https://youtu.be/dQw4w9WgXcQ?si=jok1rrhkt2JvBz4F";
var yt = new ProcessStartInfo("https://youtu.be/dQw4w9WgXcQ?si=jok1rrhkt2JvBz4F")
{
UseShellExecute = true,
Expand Down Expand Up @@ -178,7 +169,7 @@ private void FCtxt_PreviewTextInput(object sender, TextCompositionEventArgs e)
private void Reset_Click(object sender, RoutedEventArgs e)
{
FCtxt.Text = "1F1F1F";
SCtxt.Text= "00C3BA";
SCtxt.Text = "00C3BA";
TCtxt.Text = "E8E8E8";
}
}
Expand Down
13 changes: 1 addition & 12 deletions Pages/DnsManaging.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
using DnsSnap.Dns;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
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 DnsSnap.Pages
{
Expand Down Expand Up @@ -63,7 +52,7 @@ private void AddBtn_Click(object sender, RoutedEventArgs e)

private void Remove_Click(object sender, RoutedEventArgs e)
{
if (DnsList.SelectedItems.Count >0)
if (DnsList.SelectedItems.Count > 0)
{
string selected = "";
foreach (var dns in DnsList.SelectedItems)
Expand Down
2 changes: 0 additions & 2 deletions Pages/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using DnsSnap.Core;
using DnsSnap.Dns;
using DnsSnap.Function;
using DnsSnap.Pages;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Input;

Expand Down
8 changes: 4 additions & 4 deletions Pages/Setting.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Windows;
using System.Windows.Controls;
using DnsSnap.Dns;
using DnsSnap.Dns;
using System.ComponentModel;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using MessageBox = System.Windows.MessageBox;

namespace DnsSnap.Pages
Expand Down Expand Up @@ -32,7 +32,7 @@ private void GetDnsBtn_Click(object sender, RoutedEventArgs e)
WebClient client = new();
client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
string messege = "Note that by clicking yes you will lose all your dns and download the default dns file(containing 5 dns)";
MessageBoxResult result =MessageBox.Show(messege, "Are You Sure You Want To Continue?", MessageBoxButton.YesNo, MessageBoxImage.Warning);
MessageBoxResult result = MessageBox.Show(messege, "Are You Sure You Want To Continue?", MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result == MessageBoxResult.Yes)
{
client.DownloadFileAsync(new Uri(url), DnsManager.filePath);
Expand Down
5 changes: 2 additions & 3 deletions Style/Colors.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using System.Windows.Media;
using System.Globalization;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using System.Diagnostics;
using System.Windows.Media;

namespace DnsSnap.Style
{
Expand Down
5 changes: 2 additions & 3 deletions ViewModel/NotificoViewModel.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using Hardcodet.Wpf.TaskbarNotification;
using DnsSnap.Dns;
using DnsSnap.Function;
using System;
using Hardcodet.Wpf.TaskbarNotification;
using System.Windows;
using System.Windows.Input;
using DnsSnap.Dns;

namespace DnsSnap
{
Expand Down

0 comments on commit 68382c9

Please sign in to comment.