Skip to content

Commit

Permalink
UI Changes (MahApps MetroUI) , Library Updates, Complete Overhaul
Browse files Browse the repository at this point in the history
Migrated to MahApps MetroUI Framework
Compiled and updated LibreHardwareMonitor library
Moved methods and functions to their own classes
Moved and added all default hardcoded resources to Resources.resx
More small changes here and there etc ...
Bumped to v3.0.0
  • Loading branch information
SmokeyMcBong committed Jun 4, 2020
1 parent fb06967 commit d4bd13f
Show file tree
Hide file tree
Showing 29 changed files with 1,504 additions and 633 deletions.
14 changes: 7 additions & 7 deletions MiToolz.sln
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
VisualStudioVersion = 16.0.30114.105
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiToolz", "MiToolz\MiToolz.csproj", "{3F694233-1AD2-47C5-9F9A-44D5A3B37178}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MiToolz", "MiToolz\MiToolz.csproj", "{09405820-5162-4AFE-882B-7052CF1381F4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3F694233-1AD2-47C5-9F9A-44D5A3B37178}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3F694233-1AD2-47C5-9F9A-44D5A3B37178}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3F694233-1AD2-47C5-9F9A-44D5A3B37178}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3F694233-1AD2-47C5-9F9A-44D5A3B37178}.Release|Any CPU.Build.0 = Release|Any CPU
{09405820-5162-4AFE-882B-7052CF1381F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09405820-5162-4AFE-882B-7052CF1381F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09405820-5162-4AFE-882B-7052CF1381F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09405820-5162-4AFE-882B-7052CF1381F4}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E4D2769B-7641-403B-B274-795E0D63DE62}
SolutionGuid = {6DA30A5A-EFFE-4E16-9389-F4D062193CCF}
EndGlobalSection
EndGlobal
42 changes: 18 additions & 24 deletions MiToolz/App.xaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:System="clr-namespace:System;assembly=mscorlib" x:Class="MiToolz.App"
xmlns:system="clr-namespace:System;assembly=mscorlib"
x:Class="MiToolz.App"
StartupUri="MainWindow.xaml">
<Application.Resources>
<System:String x:Key="VersionNo" xml:space="preserve"> MiToolz v2.8.4 </System:String>
<System:String x:Key="VersionDate" xml:space="preserve"> Build Date : 26-05-2020 </System:String>
<System:Double x:Key="StandardWindowHeight">290</System:Double>
<System:Double x:Key="StandardWindowWidth">394</System:Double>
<System:Double x:Key="ExtendedWindowWidth">608</System:Double>
<Style x:Key="MyButton" TargetType="Button">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Name="border" BorderThickness="0" BorderBrush="Black" Background="{TemplateBinding Background}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value="0.4" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Dark.Blue.xaml" />
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<system:String x:Key="VersionNo"
xml:space="preserve"> MiToolz v3.0.0 </system:String>
<system:String x:Key="VersionDate"
xml:space="preserve"> Build Date : 03-06-2020 </system:String>
</ResourceDictionary>
</Application.Resources>
</Application>
6 changes: 2 additions & 4 deletions MiToolz/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
using System.Windows;

namespace MiToolz
namespace MiToolz
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
public partial class App
{
}
}
Binary file added MiToolz/AppIcon.ico
Binary file not shown.
70 changes: 26 additions & 44 deletions MiToolz/ConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,82 +8,64 @@

namespace MiToolz
{
class ConfigManager
internal class ConfigManager
{
readonly string Path;
readonly string EXE = Assembly.GetExecutingAssembly().GetName().Name;
private readonly string _path;
private readonly string _exe = Assembly.GetExecutingAssembly().GetName().Name;

[DllImport("kernel32", CharSet = CharSet.Unicode)]
static extern long WritePrivateProfileString(string Section, string Key, string Value, string FilePath);
private static extern long WritePrivateProfileString(string section, string key, string value, string filePath);

[DllImport("kernel32", CharSet = CharSet.Unicode)]
static extern int GetPrivateProfileString(string Section, string Key, string Default, StringBuilder RetVal, int Size, string FilePath);
private static extern int GetPrivateProfileString(string section, string key, string @default, StringBuilder retVal, int size, string filePath);

//ini file management >
public ConfigManager(string IniPath = null)
//ini file management ... >
public ConfigManager(string iniPath = null)
{
Path = new FileInfo(IniPath ?? EXE + ".ini").FullName;
_path = new FileInfo(iniPath ?? _exe + ".ini").FullName;
}

public string IniRead(string Key, string Section = null)
public string IniRead(string key, string section = null)
{
var RetVal = new StringBuilder(255);
GetPrivateProfileString(Section ?? EXE, Key, "", RetVal, 255, Path);
return RetVal.ToString();
var retVal = new StringBuilder(255);
GetPrivateProfileString(section ?? _exe, key, "", retVal, 255, _path);
return retVal.ToString();
}

public void IniWrite(string Key, string Value, string Section = null)
public void IniWrite(string key, string value, string section = null)
{
WritePrivateProfileString(Section ?? EXE, Key, Value, Path);
WritePrivateProfileString(section ?? _exe, key, value, _path);
}

public void IniDeleteKey(string Key, string Section = null)
{
IniWrite(Key, null, Section ?? EXE);
}

public void IniDeleteSection(string Section = null)
{
IniWrite(null, null, Section ?? EXE);
}
//registry key management ... >
public static string RegReadKeyValue(string subKey, string key)

public bool IniKeyExists(string Key, string Section = null)
{
return IniRead(Key, Section).Length > 0;
}

//registry key management >
public string RegReadKeyValue(string subKey, string key)
var str = string.Empty;

{
string str = string.Empty;

using (RegistryKey registryKey = Registry.CurrentUser.OpenSubKey(subKey))
using (var registryKey = Registry.CurrentUser.OpenSubKey(subKey))

{
if (registryKey != null)
{
str = registryKey.GetValue(key).ToString();
registryKey.Close();
}
if (registryKey == null) return str;
str = registryKey.GetValue(key).ToString();
registryKey.Close();
}
return str;
}

//xml file management >
public string XmlRead(string FullXmlFilePath)
//xml file management ... >
public static string XmlRead(string fullXmlFilePath)
{
string str = string.Empty;
var str = string.Empty;

XDocument doc = XDocument.Load(FullXmlFilePath);
var doc = XDocument.Load(fullXmlFilePath);
var selectors = from elements in doc.Elements("profile").Elements("info")
select elements;

foreach (var element in selectors)
{
str = element.Element("profile_name").Value;
str = element.Element("profile_name")?.Value;
}

return str;
}
}
Expand Down
52 changes: 52 additions & 0 deletions MiToolz/KeyManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
using System.Windows.Forms;

namespace MiToolz
{
internal static class KeyManager
{
private static string ControlKey()
{
return "^";
}

private static string ShiftKey()
{
return "+";
}

private static string AltKey()
{
return "%";
}

internal static void HotKeySender(string keyPressModifier, string keyPress)
{
var keyPressCombo = "";

if (keyPress != "--")
{
if (keyPressModifier == "--")
{
keyPressCombo = "{" + keyPress + "}";
}
if (keyPressModifier != "--")
{
if (keyPressModifier == "Ctrl")
{
keyPressModifier = ControlKey();
}
if (keyPressModifier == "Shft")
{
keyPressModifier = ShiftKey();
}
if (keyPressModifier == "Alt")
{
keyPressModifier = AltKey();
}
keyPressCombo = "(" + keyPressModifier + "{" + keyPress + "}" + ")";
}
}
SendKeys.SendWait(keyPressCombo);
}
}
}
Binary file added MiToolz/Libs/ControlzEx.dll
Binary file not shown.
Binary file modified MiToolz/Libs/LibreHardwareMonitorLib.dll
Binary file not shown.
Binary file added MiToolz/Libs/MahApps.Metro.dll
Binary file not shown.
Binary file added MiToolz/Libs/Microsoft.Xaml.Behaviors.dll
Binary file not shown.
Loading

0 comments on commit d4bd13f

Please sign in to comment.