Skip to content

Commit

Permalink
Changes for the next version
Browse files Browse the repository at this point in the history
  • Loading branch information
hellzerg committed Apr 9, 2021
1 parent 387190f commit 16ddede
Show file tree
Hide file tree
Showing 24 changed files with 1,861 additions and 131 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

## [7.1] - 2021-04-09
- New: Pinger allows quick pinging and SHODAN.io search
- New: Quick Access menu - enable it in Options
- New: Allow only once instance to run
- Hotfix: Error handling when HOSTS file is unreadable - again

## [7.0] - 2021-04-08
- New: Check space to be freed before cleaning
- Hotfix: Error handling when HOSTS file is unreadable
Expand Down
3 changes: 3 additions & 0 deletions IMAGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/7.PNG)
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/8.PNG)
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/9.PNG)
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/10.PNG)
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/11.PNG)
![alt](https://raw.githubusercontent.com/hellzerg/optimizer/master/images/12.PNG)
91 changes: 91 additions & 0 deletions Optimizer/ColoredControls/ToolStripRendererMaterial.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Optimizer
{
internal class ToolStripRendererMaterial : ToolStripProfessionalRenderer
{
internal ToolStripRendererMaterial() : base(new ColorsMaterial())
{

}
}

internal class ColorsMaterial : ProfessionalColorTable
{
public override Color ImageMarginGradientBegin
{
get
{
return Options.BackgroundColor;
}
}
public override Color ImageMarginGradientMiddle
{
get
{
return Options.BackgroundColor;
}
}
public override Color ImageMarginGradientEnd
{
get
{
return Options.BackgroundColor;
}
}

public override Color ToolStripBorder
{
get
{
return Options.ForegroundColor;
}
}

public override Color MenuBorder
{
get
{
return Options.ForegroundColor;
}
}

public override Color MenuItemSelected
{
get
{
return Options.ForegroundAccentColor;
}
}

public override Color MenuItemSelectedGradientBegin
{
get
{
return Options.ForegroundAccentColor;
}
}

public override Color MenuItemSelectedGradientEnd
{
get
{
return Options.ForegroundAccentColor;
}
}

public override Color MenuItemBorder
{
get
{
return Options.ForegroundColor;
}
}
}
}
22 changes: 18 additions & 4 deletions Optimizer/HostsHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,16 @@ internal static string[] ReadHosts()
{
StringBuilder sb = new StringBuilder();

using (StreamReader sr = File.OpenText(HostsFile))
try
{
using (StreamReader sr = File.OpenText(HostsFile))
{
sb.Append(sr.ReadToEnd());
}
}
catch (Exception ex)
{
sb.Append(sr.ReadToEnd());
ErrorLogger.LogError("HostsHelper.ReadHosts", ex.Message, ex.StackTrace);
}

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

using (StreamReader sr = File.OpenText(HostsFile))
try
{
using (StreamReader sr = File.OpenText(HostsFile))
{
sb.Append(sr.ReadToEnd());
}
}
catch (Exception ex)
{
sb.Append(sr.ReadToEnd());
ErrorLogger.LogError("HostsHelper.ReadHostsFast", ex.Message, ex.StackTrace);
}

return sb.ToString();
Expand Down
Loading

0 comments on commit 16ddede

Please sign in to comment.