Skip to content

Commit

Permalink
major update
Browse files Browse the repository at this point in the history
Rename objects to follow naming convention
Add a "Bring To Front" option in the system tray context menu
Add a toggle for "Always on Top" to the system tray context menu
Improve the layout of controls
Improve the visual style of combo boxes
Fix autocomplete for hotkey & target comboboxes
Apply code formatting preferences
Improve tab stop indexes
Consolidate always on top settings into a property
Add a bring to front event handler
Disable toast setting members when the toast is disabled.
  • Loading branch information
radj307 committed Feb 24, 2022
1 parent 7075ea6 commit e05f518
Show file tree
Hide file tree
Showing 21 changed files with 191 additions and 139 deletions.
11 changes: 3 additions & 8 deletions AudioAPI/AudioSessionList.cs
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
using AudioAPI.WindowsAPI.Audio.MMDeviceAPI.Enum;
using AudioAPI.WindowsAPI.Audio;
using AudioAPI.WindowsAPI.Audio.MMDeviceAPI;
using AudioAPI.WindowsAPI.Audio;
using System;
using System.Collections.Generic;
using AudioAPI.WindowsAPI.Audio.MMDeviceAPI.Enum;
using System.Collections;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Runtime.InteropServices;
using System.Collections;

namespace AudioAPI
{
Expand Down
4 changes: 2 additions & 2 deletions AudioAPI/System.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ public class System
public static bool VersionGreaterThan(int major, int minor)
{
int os_major = Environment.OSVersion.Version.Major, os_minor = Environment.OSVersion.Version.Minor;
return os_major > major || ( os_major == major && os_minor >= minor );
return os_major > major || (os_major == major && os_minor >= minor);
}
public static object? GetManagementObject(string property)
{
object? obj = null;
try
{
IEnumerable<ManagementObject> objects = new ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem").Get().OfType<ManagementObject>();
obj = ( from it in objects select it.GetPropertyValue(property) ).FirstOrDefault();
obj = (from it in objects select it.GetPropertyValue(property)).FirstOrDefault();
}
catch (Exception) { }
return obj;
Expand Down
4 changes: 2 additions & 2 deletions AudioAPI/VolumeHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public static void SetVolume(string proc_name, decimal level)
throw new COMException("Volume object creation failed");

Guid guid = Guid.Empty;
volume.SetMasterVolume((float)( level / 100.0m ), ref guid);
volume.SetMasterVolume((float)(level / 100.0m), ref guid);
Marshal.ReleaseComObject(volume);
}

Expand Down Expand Up @@ -203,7 +203,7 @@ public static void SetVolume(int proc_id, decimal level)
throw new COMException("Volume object creation failed");

Guid guid = Guid.Empty;
volume.SetMasterVolume((float)( level / 100.0m ), ref guid);
volume.SetMasterVolume((float)(level / 100.0m), ref guid);
Marshal.ReleaseComObject(volume);
}

Expand Down
2 changes: 1 addition & 1 deletion HotkeyLib/Hotkey.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public void Reset(Hotkey o)
Win = o.Win;
KeyCode = o.KeyCode;

Reregister();
Reregister();
}
public Hotkey Clone() => new(keyCode, shift, control, alt, windows);

Expand Down
4 changes: 2 additions & 2 deletions ProcessEventLog/Internal/MessageBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ protected MessageBase(Filter.MessageType type, string msg)
_msg = msg;
}

private Filter.MessageType _type;
private string _msg;
private readonly Filter.MessageType _type;
private readonly string _msg;

public Filter.MessageType Type { get => _type; }
public string Message { get => _msg; }
Expand Down
2 changes: 1 addition & 1 deletion ToastForm/Extensions/FloatingPointExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public static bool EqualsWithin(this float f, float compare, float epsilon = flo
}
public static bool EqualsWithin(this float f, double compare, double epsilon = double.Epsilon)
{
return (((double)f) - compare <= epsilon);
return (f - compare <= epsilon);
}
public static bool EqualsWithin(this double d, double compare, double epsilon = double.Epsilon)
{
Expand Down
6 changes: 3 additions & 3 deletions ToastForm/ToastForm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using UIComposites;
using ToastForm.Extensions;
using ToastForm.Extensions;
using UIComposites;

namespace VolumeControl
{
Expand Down Expand Up @@ -262,7 +262,7 @@ private void ListDisplay_ItemCheck(object? sender, ItemCheckEventArgs e)
private void ListDisplay_ItemActivate(object? sender, EventArgs e)
{
DisableListEventTriggers(); //< Don't trigger event recursively (causes stack overflow)

foreach (ListViewItem item in ListDisplay.Items)
{
if (item == null)
Expand Down
4 changes: 2 additions & 2 deletions ToastForm/ToastForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAKgEAAAJNU0Z0AUkBTAIBAQIB
AAFQAQABUAEAARABAAEQAQAE/wEFAQAI/wFCAU0BdgcAAXYDAAEoAwABQAMAARADAAEBAQABBAYAAQIY
AAFYAQABWAEAARABAAEQAQAE/wEFAQAI/wFCAU0BdgcAAXYDAAEoAwABQAMAARADAAEBAQABBAYAAQIY
AAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8B
AAL/AgAD//8A/wADAAFCAU0BPgcAAT4DAAEoAwABQAMAARADAAEBAQABAQUAAYAXAAP/AQAE/wQAAv8B
gAEBBAAC/wG/Af0EAAL/Ab8B/QQAAv8BgAEBBAAE/wQAAv8BgAEBBAAC/wG/Af0EAAL/Ab8B/QQAAv8B
Expand All @@ -83,7 +83,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAEZTeXN0ZW0uV2luZG93cy5Gb3JtcywgQ3VsdHVyZT1uZXV0cmFs
LCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5BQEAAAAmU3lzdGVtLldpbmRvd3MuRm9ybXMu
SW1hZ2VMaXN0U3RyZWFtZXIBAAAABERhdGEHAgIAAAAJAwAAAA8DAAAAFgIAAAJNU0Z0AUkBTAIBAQUB
AAFQAQABUAEAARABAAEQAQAE/wEFAQAI/wFCAU0BdgcAAXYDAAEoAwABQAMAASADAAEBAQABBAYAAQQY
AAFYAQABWAEAARABAAEQAQAE/wEFAQAI/wFCAU0BdgcAAXYDAAEoAwABQAMAASADAAEBAQABBAYAAQQY
AAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8B
AAL/AgAD/0IABpkaAAaZegAGmRoABpl6AAaZGgAGmaoABqoCAAa7EgAGqgIABrt6AAa7GgAGu+EAAUIB
TQE+BwABPgMAASgDAAFAAwABIAMAAQEBAAEBBgABARYAA/8BAAL/BgABgAEBBgABgAEBBgABgAEBBgAB
Expand Down
2 changes: 1 addition & 1 deletion UIComposites/ColorSchemes/IColorBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

namespace UIComposites.ColorSchemes
{
public interface IControlTheme : IReadOnlyControlTheme {}
public interface IControlTheme : IReadOnlyControlTheme { }
}
8 changes: 8 additions & 0 deletions UIComposites/GlobalSuppressions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.

using System.Diagnostics.CodeAnalysis;

[assembly: SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "<Pending>", Scope = "member", Target = "~M:UIComposites.ToastSettings.cb_EnableNotification_CheckedChanged(System.Object,System.EventArgs)")]
12 changes: 6 additions & 6 deletions UIComposites/HotkeyEditor.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions UIComposites/HotkeyEditor.resx
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
<metadata name="keyListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="keyListBindingSource.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="Checkbox_ModifierKey_Ctrl.Locked" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
Expand Down
2 changes: 1 addition & 1 deletion UIComposites/NumberUpDownWithLabel.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 21 additions & 20 deletions UIComposites/SettingsPane.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e05f518

Please sign in to comment.