Skip to content

Commit 16ddede

Browse files
committed
Changes for the next version
1 parent 387190f commit 16ddede

24 files changed

+1861
-131
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [7.1] - 2021-04-09
6+
- New: Pinger allows quick pinging and SHODAN.io search
7+
- New: Quick Access menu - enable it in Options
8+
- New: Allow only once instance to run
9+
- Hotfix: Error handling when HOSTS file is unreadable - again
10+
511
## [7.0] - 2021-04-08
612
- New: Check space to be freed before cleaning
713
- Hotfix: Error handling when HOSTS file is unreadable

IMAGES.md

+3
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@
77
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/7.PNG)
88
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/8.PNG)
99
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/9.PNG)
10+
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/10.PNG)
11+
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/11.PNG)
12+
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/12.PNG)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Drawing;
4+
using System.Linq;
5+
using System.Text;
6+
using System.Threading.Tasks;
7+
using System.Windows.Forms;
8+
9+
namespace Optimizer
10+
{
11+
internal class ToolStripRendererMaterial : ToolStripProfessionalRenderer
12+
{
13+
internal ToolStripRendererMaterial() : base(new ColorsMaterial())
14+
{
15+
16+
}
17+
}
18+
19+
internal class ColorsMaterial : ProfessionalColorTable
20+
{
21+
public override Color ImageMarginGradientBegin
22+
{
23+
get
24+
{
25+
return Options.BackgroundColor;
26+
}
27+
}
28+
public override Color ImageMarginGradientMiddle
29+
{
30+
get
31+
{
32+
return Options.BackgroundColor;
33+
}
34+
}
35+
public override Color ImageMarginGradientEnd
36+
{
37+
get
38+
{
39+
return Options.BackgroundColor;
40+
}
41+
}
42+
43+
public override Color ToolStripBorder
44+
{
45+
get
46+
{
47+
return Options.ForegroundColor;
48+
}
49+
}
50+
51+
public override Color MenuBorder
52+
{
53+
get
54+
{
55+
return Options.ForegroundColor;
56+
}
57+
}
58+
59+
public override Color MenuItemSelected
60+
{
61+
get
62+
{
63+
return Options.ForegroundAccentColor;
64+
}
65+
}
66+
67+
public override Color MenuItemSelectedGradientBegin
68+
{
69+
get
70+
{
71+
return Options.ForegroundAccentColor;
72+
}
73+
}
74+
75+
public override Color MenuItemSelectedGradientEnd
76+
{
77+
get
78+
{
79+
return Options.ForegroundAccentColor;
80+
}
81+
}
82+
83+
public override Color MenuItemBorder
84+
{
85+
get
86+
{
87+
return Options.ForegroundColor;
88+
}
89+
}
90+
}
91+
}

Optimizer/HostsHelper.cs

+18-4
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,16 @@ internal static string[] ReadHosts()
118118
{
119119
StringBuilder sb = new StringBuilder();
120120

121-
using (StreamReader sr = File.OpenText(HostsFile))
121+
try
122+
{
123+
using (StreamReader sr = File.OpenText(HostsFile))
124+
{
125+
sb.Append(sr.ReadToEnd());
126+
}
127+
}
128+
catch (Exception ex)
122129
{
123-
sb.Append(sr.ReadToEnd());
130+
ErrorLogger.LogError("HostsHelper.ReadHosts", ex.Message, ex.StackTrace);
124131
}
125132

126133
return sb.ToString().Split(Environment.NewLine.ToCharArray());
@@ -131,9 +138,16 @@ internal static string ReadHostsFast()
131138
{
132139
StringBuilder sb = new StringBuilder();
133140

134-
using (StreamReader sr = File.OpenText(HostsFile))
141+
try
142+
{
143+
using (StreamReader sr = File.OpenText(HostsFile))
144+
{
145+
sb.Append(sr.ReadToEnd());
146+
}
147+
}
148+
catch (Exception ex)
135149
{
136-
sb.Append(sr.ReadToEnd());
150+
ErrorLogger.LogError("HostsHelper.ReadHostsFast", ex.Message, ex.StackTrace);
137151
}
138152

139153
return sb.ToString();

0 commit comments

Comments
 (0)