Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 71b48883b3 | |||
| e3ae12d33d |
@@ -5,7 +5,7 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:local="clr-namespace:KurtzPelRegionPicker"
|
xmlns:local="clr-namespace:KurtzPelRegionPicker"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="KPRP" Height="190" Width="220"
|
Title="KPRP" Height="225" Width="220"
|
||||||
ResizeMode="CanMinimize">
|
ResizeMode="CanMinimize">
|
||||||
<StackPanel Orientation="Vertical"
|
<StackPanel Orientation="Vertical"
|
||||||
Margin="10">
|
Margin="10">
|
||||||
@@ -19,5 +19,9 @@
|
|||||||
Height="25"
|
Height="25"
|
||||||
Content="Apply"
|
Content="Apply"
|
||||||
Click="Button_Apply_Click" />
|
Click="Button_Apply_Click" />
|
||||||
|
<Button Height="25"
|
||||||
|
Background="#FFD2D2"
|
||||||
|
Content="Reset"
|
||||||
|
Click="Button_Reset_Click" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -55,6 +55,13 @@ namespace KurtzPelRegionPicker
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void Button_Reset_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
ResetRegion();
|
||||||
|
|
||||||
|
MessageBox.Show("Region reset", "Success", MessageBoxButton.OK, MessageBoxImage.Information);
|
||||||
|
}
|
||||||
|
|
||||||
private void ApplyRegion(Region source, Region destination)
|
private void ApplyRegion(Region source, Region destination)
|
||||||
{
|
{
|
||||||
string[] content = File.ReadAllLines(HOSTS_PATH);
|
string[] content = File.ReadAllLines(HOSTS_PATH);
|
||||||
@@ -85,6 +92,25 @@ namespace KurtzPelRegionPicker
|
|||||||
File.WriteAllLines(HOSTS_PATH, newContent);
|
File.WriteAllLines(HOSTS_PATH, newContent);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ResetRegion()
|
||||||
|
{
|
||||||
|
string[] content = File.ReadAllLines(HOSTS_PATH);
|
||||||
|
|
||||||
|
if (content.Contains(COMMENT))
|
||||||
|
{
|
||||||
|
// Purge
|
||||||
|
int index = content.IndexOf(COMMENT);
|
||||||
|
|
||||||
|
var list = content.ToList();
|
||||||
|
|
||||||
|
list.RemoveAt(index);
|
||||||
|
list.RemoveAt(index);
|
||||||
|
|
||||||
|
content = list.ToArray();
|
||||||
|
File.WriteAllLines(HOSTS_PATH, content);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string GetRealIP(string dns)
|
private string GetRealIP(string dns)
|
||||||
{
|
{
|
||||||
var process = new Process()
|
var process = new Process()
|
||||||
|
|||||||
@@ -51,5 +51,5 @@ using System.Windows;
|
|||||||
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
|
// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
|
||||||
// en utilisant '*', comme indiqué ci-dessous :
|
// en utilisant '*', comme indiqué ci-dessous :
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.0.0")]
|
[assembly: AssemblyVersion("1.1.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
[assembly: AssemblyFileVersion("1.1.0.0")]
|
||||||
|
|||||||
Reference in New Issue
Block a user