Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Battify/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Battify"
StartupUri="MainWindow.xaml">
StartupUri="Views/MainWindow.xaml">
<Application.Resources>
<!-- Set the inherited default font for all WPF windows and controls. -->
<Style TargetType="{x:Type Window}">
Expand Down
2 changes: 1 addition & 1 deletion Battify/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Battify
/// </summary>
public partial class App : System.Windows.Application
{
private static Mutex _mutex = null;
private static Mutex? _mutex;
private const string MutexName = "Global\\Battify_SingleInstance_Mutex_9F8A3B2C";

protected override void OnStartup(StartupEventArgs e)
Expand Down
5 changes: 3 additions & 2 deletions Battify/Battify.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
<AutoGen>True</AutoGen>
<DependentUpon>DefAlertSound.resx</DependentUpon>
</Compile>
<Compile Update="Settings.Designer.cs">
<Compile Update="Configuration\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
Expand Down Expand Up @@ -111,9 +111,10 @@
</ItemGroup>

<ItemGroup>
<None Update="Settings.settings">
<None Update="Configuration\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
<CustomToolNamespace>Battify</CustomToolNamespace>
</None>
</ItemGroup>

Expand Down

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

File renamed without changes.
File renamed without changes.
2 changes: 0 additions & 2 deletions Battify/TrayControl.cs → Battify/Controls/TrayControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ namespace Battify
public partial class TrayControl : UserControl
{
public MainWindow mainWindow;
private bool balloonHandlerRegistered = false;

public TrayControl(MainWindow w)
{
Expand All @@ -29,7 +28,6 @@ public TrayControl(MainWindow w)

// BalloonTipClicked 이벤트를 한 번만 등록
trayIcon.BalloonTipClicked += TrayIcon_BalloonTipClicked;
balloonHandlerRegistered = true;

// 3초간 비동기 대기후 시작프로그램 체크
Task.Run(async () =>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,8 @@ public static string Get(string parameter)
{
return batteryInfo[parameter];
}
else
{
return null;
}

return string.Empty;
}

public static void StartChecking(int interval = 5000)
Expand All @@ -118,9 +116,11 @@ public static void StartChecking(int interval = 5000)

public static void StopChecking()
{
if (!isChecking) return;
if (!isChecking || timer is null) return;

timer.Stop();
timer.Dispose();
timer = null;
isChecking = false;
}

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public static bool CheckStartup()
using var key = Registry.CurrentUser.OpenSubKey(RunKeyPath, writable: false);
var value = key?.GetValue(ValueName) as string;

if (string.IsNullOrWhiteSpace(value))
if (value is null || string.IsNullOrWhiteSpace(value))
return false;

return string.Equals(value.Trim(), QuoteExecutablePath(GetExecutablePath()), StringComparison.OrdinalIgnoreCase);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -455,9 +455,9 @@ public void UpdateIcon(int percentage)

Icon icon = effectiveTrayTheme switch
{
"white" => BattIconWhite.ResourceManager.GetObject("_" + percentage.ToString()) as Icon,
"black" => BattIconBlack.ResourceManager.GetObject("_" + percentage.ToString()) as Icon,
_ => BattIconWhite.ResourceManager.GetObject("_" + percentage.ToString()) as Icon
"white" => BattIconWhite.ResourceManager.GetObject("_" + percentage.ToString()) as Icon ?? SystemIcons.Application,
"black" => BattIconBlack.ResourceManager.GetObject("_" + percentage.ToString()) as Icon ?? SystemIcons.Application,
_ => BattIconWhite.ResourceManager.GetObject("_" + percentage.ToString()) as Icon ?? SystemIcons.Application
};

trayControl.trayIcon.Icon = icon;
Expand Down
File renamed without changes.
File renamed without changes.
Binary file removed Battify/icon.png
Binary file not shown.
Binary file removed Battify/icon_old.ico
Binary file not shown.
Loading