Compare commits

...
23 Commits
Author SHA1 Message Date
ckaczor 5aeefebc47 Add logging and track mute state
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 33s
2026-08-18 15:18:25 -04:00
ckaczor ca956f207b Adjust mute detection/logging
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 33s
2026-08-18 14:59:20 -04:00
ckaczor ad212e7416 Log volume notifications
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 33s
2026-08-18 14:52:56 -04:00
ckaczor 8c63b93d09 Tweak logging and change settings string
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 33s
2026-08-18 14:43:22 -04:00
ckaczor 6ba4854bd8 Fix update check URL
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 32s
2026-08-18 13:14:46 -04:00
ckaczor 2be5b86b17 Fix a few architecture flags
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 31s
2026-08-18 13:09:01 -04:00
ckaczor a75a2d8926 Update main with latest code
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 34s
2026-08-18 13:05:35 -04:00
ckaczor f97621c37b Skip download since no first release
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Successful in 34s
2026-08-18 13:00:59 -04:00
ckaczor d76d148c67 Empy change to trigger build since not on default branch
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Failing after 29s
2026-08-18 12:54:15 -04:00
ckaczor 3c1a931f26 Enable windows targeting
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Failing after 30s
2026-08-18 12:35:33 -04:00
ckaczor 7a246bb61b Update actions runner requirements
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Failing after 54s
2026-08-18 12:32:04 -04:00
ckaczor 3c6f648e4e Test actions trigger
Deploy to Gitea Releases / deploy-to-gitea-releases (push) Canceled after 0s
2026-08-18 12:28:49 -04:00
ckaczor f372f99d95 Trigger workflow on develop branch for now 2026-08-18 12:23:09 -04:00
ckaczor 84d2435b83 More modernization 2026-08-18 12:18:31 -04:00
ckaczor e64c6878c1 Restore old readme 2026-08-07 10:53:06 -04:00
ckaczor a29fcfe9a6 Delete old junk from branch merge 2026-08-07 10:50:47 -04:00
ckaczor 4b9145054b Start modernization
# Conflicts:
#	.gitignore
#	App.xaml
#	App.xaml.cs
#	AudioWatcher.cs
#	Delcom/DeviceManagement.cs
#	Delcom/StoplightIndicator.cs
#	LICENSE.md
#	LightController.cs
#	Properties/AssemblyInfo.cs
#	Properties/Resources.Designer.cs
#	Properties/Resources.resx
#	Properties/Settings.Designer.cs
#	Properties/Settings.settings
#	README.md
#	UpdateCheck.cs
#	WorkIndicator.csproj
#	WorkIndicator.sln
#	WorkIndicator.sln.DotSettings
2026-08-07 10:46:25 -04:00
ckaczor 287c008117 Make sure icon gets removed 2021-12-20 14:01:48 -05:00
ckaczor 42301d5242 More startup/upgrade cleanup 2021-12-20 13:57:21 -05:00
ckaczor 3d10cc9635 Clean up startup 2021-12-20 13:52:34 -05:00
ckaczor 714bd0384a Add IPC listener and tweak update messages 2021-12-20 13:43:14 -05:00
ckaczor fbb797968d Add update button to about 2021-12-20 13:14:00 -05:00
ckaczor e609bebbbc Fix for settings 2021-12-20 13:05:11 -05:00
45 changed files with 1390 additions and 1378 deletions
-63
View File
@@ -1,63 +0,0 @@
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
###############################################################################
# Set default behavior for command prompt diff.
#
# This is need for earlier builds of msysgit that does not have it on by
# default for csharp files.
# Note: This is only used by command line
###############################################################################
#*.cs diff=csharp
###############################################################################
# Set the merge driver for project and solution files
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
###############################################################################
#*.sln merge=binary
#*.csproj merge=binary
#*.vbproj merge=binary
#*.vcxproj merge=binary
#*.vcproj merge=binary
#*.dbproj merge=binary
#*.fsproj merge=binary
#*.lsproj merge=binary
#*.wixproj merge=binary
#*.modelproj merge=binary
#*.sqlproj merge=binary
#*.wwaproj merge=binary
###############################################################################
# behavior for image files
#
# image files are treated as binary by default.
###############################################################################
#*.jpg binary
#*.png binary
#*.gif binary
###############################################################################
# diff behavior for common document formats
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
#*.DOC diff=astextplain
#*.docx diff=astextplain
#*.DOCX diff=astextplain
#*.dot diff=astextplain
#*.DOT diff=astextplain
#*.pdf diff=astextplain
#*.PDF diff=astextplain
#*.rtf diff=astextplain
#*.RTF diff=astextplain
+36
View File
@@ -0,0 +1,36 @@
name: Deploy to Gitea Releases
on:
push:
branches:
- main
workflow_dispatch:
jobs:
deploy-to-gitea-releases:
runs-on: ubuntu-latest-x86-64
container:
image: ghcr.io/catthehacker/ubuntu:dotnet-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Get next version
uses: reecetech/version-increment@2024.4.3
id: version
with:
scheme: calver
- name: Publish Application
run: dotnet publish WorkIndicator.csproj -r win-x86 -c Release -o publish
- name: Create Velopack Release
run: |
export PATH="$PATH:/root/.dotnet/tools"
dotnet tool install -g vpk
vpk [win] download gitea --channel win-x86 --repoUrl https://gitea.kaczorzoo.net/ckaczor/WorkIndicator
vpk [win] pack --channel win-x86 -u WorkIndicator -v ${{ steps.version.outputs.version }} -p publish --packTitle "Work Indicator" --shortcuts StartMenuRoot --framework net10.0-x86-desktop
vpk [win] upload gitea --channel win-x86 --repoUrl https://gitea.kaczorzoo.net/ckaczor/WorkIndicator --publish --releaseName "${{ steps.version.outputs.version }}" --token ${{ secrets.VPK_TOKEN }}
+278 -37
View File
@@ -1,34 +1,84 @@
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# Build results
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
build/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
@@ -38,26 +88,41 @@ build/
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
@@ -65,6 +130,7 @@ ipch/
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
@@ -72,9 +138,30 @@ _TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
*.ncrunch*
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
@@ -93,65 +180,219 @@ DocProject/Help/html
publish/
# Publish Web Output
*.Publish.xml
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# NuGet Packages Directory
packages/
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# Windows Azure Build Output
csx
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Windows Store app package directory
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
# Microsoft Fakes
FakesAssemblies/
# =========================
# Windows detritus
# =========================
# GhostDoc plugin setting file
*.GhostDoc.xml
# Windows image file caches
Thumbs.db
ehthumbs.db
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Folder config file
Desktop.ini
# Visual Studio 6 build log
*.plg
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Visual Studio 6 workspace options file
*.opt
# Mac desktop service store files
.DS_Store
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
.vs/
# Visual Studio 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
-6
View File
@@ -1,6 +0,0 @@
[submodule "Common"]
path = Common
url = https://github.com/ckaczor/Common.git
[submodule "Common.Wpf"]
path = Common.Wpf
url = https://github.com/ckaczor/Common.Wpf.git
+27
View File
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="WorkIndicator.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<userSettings>
<WorkIndicator.Properties.Settings>
<setting name="WindowSettings" serializeAs="String">
<value />
</setting>
<setting name="AutoStart" serializeAs="String">
<value>True</value>
</setting>
<setting name="CheckVersionAtStartup" serializeAs="String">
<value>True</value>
</setting>
<setting name="DefaultStatus" serializeAs="String">
<value>Working</value>
</setting>
</WorkIndicator.Properties.Settings>
</userSettings>
</configuration>
+2 -2
View File
@@ -1,8 +1,8 @@
<Application x:Class="WorkIndicator.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ShutdownMode="OnExplicitShutdown">
<Application.Resources>
</Application.Resources>
</Application>
</Application>
+20 -87
View File
@@ -1,96 +1,29 @@
using Common.Helpers;
using Common.IO;
using Common.Wpf.Extensions;
using Squirrel;
using System;
using System.Threading.Tasks;
using ChrisKaczor.Wpf.Application;
using System.Diagnostics;
using System.Windows;
using System.Windows.Threading;
using Settings = WorkIndicator.Properties.Settings;
namespace WorkIndicator
namespace WorkIndicator;
public partial class App
{
public partial class App
protected override void OnStartup(StartupEventArgs e)
{
private IDisposable _isolationHandle;
base.OnStartup(e);
public static string UpdateUrl = "https://github.com/ckaczor/WorkIndicator";
Current.SetStartWithWindows(!Debugger.IsAttached && Settings.Default.AutoStart);
private Dispatcher _dispatcher;
NotificationIcon.Initialize();
[STAThread]
public static void Main(string[] args)
{
SquirrelAwareApp.HandleEvents(onAppUpdate: version => Common.Settings.Extensions.RestoreSettings());
var application = new App();
application.InitializeComponent();
application.Run();
}
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
_dispatcher = Dispatcher.CurrentDispatcher;
// Initialize the tray icon
TrayIcon.Initialize();
Task.Factory.StartNew(UpdateApp).ContinueWith(task => StartUpdate(task.Result.Result));
}
private void StartUpdate(bool updateRequired)
{
if (updateRequired)
return;
Task.Factory.StartNew(() =>
{
// Create an isolation handle to see if we are already running
_isolationHandle = ApplicationIsolation.GetIsolationHandle();
// If there is another copy then pass it the command line and exit
if (_isolationHandle == null)
{
InterprocessMessageSender.SendMessage(Environment.CommandLine);
Shutdown();
return;
}
// Set automatic start into the registry
Current.SetStartWithWindows(Settings.Default.StartWithWindows);
// Initialize the light controller
LightController.Initialize();
});
}
private async Task<bool> UpdateApp()
{
return await UpdateCheck.CheckUpdate(HandleUpdateStatus);
}
private void HandleUpdateStatus(UpdateCheck.UpdateStatus status, string message)
{
if (status == UpdateCheck.UpdateStatus.None)
message = WorkIndicator.Properties.Resources.Loading;
_dispatcher.Invoke(() => TrayIcon.SetText(message));
}
protected override void OnExit(ExitEventArgs e)
{
// Get rid of the light controller
LightController.Dispose();
// Get rid of the tray icon
TrayIcon.Dispose();
// Get rid of the isolation handle
_isolationHandle.Dispose();
base.OnExit(e);
}
LightController.Initialize();
}
}
protected override void OnExit(ExitEventArgs e)
{
LightController.Dispose();
NotificationIcon.Dispose();
base.OnExit(e);
}
}
+112
View File
@@ -0,0 +1,112 @@
using NAudio.CoreAudioApi;
using NAudio.CoreAudioApi.Interfaces;
using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
namespace WorkIndicator;
internal class AudioDevice : IAudioSessionEventsHandler
{
private readonly ILogger _logger;
private readonly string _friendlyName;
private readonly Dictionary<string, AudioSessionControl> _sessions = new();
private bool _muted;
public delegate void AudioSessionsChangedDelegate();
public event AudioSessionsChangedDelegate AudioSessionsChanged;
public AudioDevice(MMDevice device)
{
_logger = Log.ForContext<AudioDevice>();
_friendlyName = device.DeviceFriendlyName;
_muted = device.AudioEndpointVolume.Mute;
_logger.Information("AudioDevice: {name} {muted}", _friendlyName, _muted);
device.AudioEndpointVolume.OnVolumeNotification += AudioEndpointVolume_OnVolumeNotification;
device.AudioSessionManager.AudioSessionControl.RegisterEventClient(this);
device.AudioSessionManager.OnSessionCreated += AudioSessionManager_OnSessionCreated;
device.AudioSessionManager.RefreshSessions();
var sessions = device.AudioSessionManager.Sessions;
for (var i = 0; i < sessions.Count; i++)
{
SetupSession(sessions[i]);
}
}
private void AudioEndpointVolume_OnVolumeNotification(AudioVolumeNotificationData data)
{
_logger.Information("AudioEndpointVolume_OnVolumeNotification: {name} {muted}", _friendlyName, data.Muted);
_muted = data.Muted;
}
private void AudioSessionManager_OnSessionCreated(object sender, IAudioSessionControl newSession)
{
var session = new AudioSessionControl(newSession);
_logger.Information("OnSessionCreated: {name}", session.GetSessionIdentifier);
SetupSession(session);
}
private void SetupSession(AudioSessionControl session)
{
_logger.Information("SetupSession: {name}", session.GetSessionIdentifier);
_sessions[session.GetSessionIdentifier] = session;
session.RegisterEventClient(this);
AudioSessionsChanged?.Invoke();
}
public int ActiveSessionCount => _sessions.Values.Count(s => s.State == AudioSessionState.AudioSessionStateActive);
void IAudioSessionEventsHandler.OnVolumeChanged(float volume, bool isMuted)
{
_logger.Information("OnVolumeChanged: {name} {volume} {isMuted}", _friendlyName, volume, isMuted);
}
void IAudioSessionEventsHandler.OnDisplayNameChanged(string displayName)
{
_logger.Information("OnDisplayNameChanged: {name}", displayName);
}
void IAudioSessionEventsHandler.OnIconPathChanged(string iconPath)
{
_logger.Information("OnIconPathChanged: {path}", iconPath);
}
void IAudioSessionEventsHandler.OnChannelVolumeChanged(uint channelCount, IntPtr newVolumes, uint channelIndex)
{
_logger.Information("OnChannelVolumeChanged: {channelCount} {newVolumes} {channelIndex}", channelCount, newVolumes, channelIndex);
}
void IAudioSessionEventsHandler.OnGroupingParamChanged(ref Guid groupingId)
{
_logger.Information("OnGroupingParamChanged: {groupingId}", groupingId);
}
void IAudioSessionEventsHandler.OnStateChanged(AudioSessionState state)
{
_logger.Information("OnStateChanged: {state}", state);
AudioSessionsChanged?.Invoke();
if (state == AudioSessionState.AudioSessionStateExpired)
{
}
}
void IAudioSessionEventsHandler.OnSessionDisconnected(AudioSessionDisconnectReason disconnectReason)
{
_logger.Information("OnSessionDisconnected: {disconnectReason}", disconnectReason);
}
}
+98 -78
View File
@@ -1,91 +1,111 @@
using CSCore.CoreAudioAPI;
using System;
using NAudio.CoreAudioApi;
using NAudio.CoreAudioApi.Interfaces;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using Serilog;
namespace WorkIndicator
namespace WorkIndicator;
internal class AudioWatcher : IMMNotificationClient
{
public static class AudioWatcher
private readonly ILogger _logger = Log.ForContext<AudioWatcher>();
private readonly MMDeviceEnumerator _deviceEnumerator = new();
private readonly Dictionary<string, AudioDevice> _inputDevices = new();
public delegate void MicrophoneInUseChangedDelegate(bool microphoneInUse);
public event MicrophoneInUseChangedDelegate MicrophoneInUseChanged;
public void Start()
{
public delegate void MicrophoneInUseChangedDelegate(bool microphoneInUse);
_logger.Information("Start");
private static ManualResetEvent _manualResetEvent;
_deviceEnumerator.RegisterEndpointNotificationCallback(this);
private static readonly Dictionary<string, int> ActiveSessions = new Dictionary<string, int>();
_logger.Information("Getting capture devices");
public static event MicrophoneInUseChangedDelegate MicrophoneInUseChanged;
var captureDevices = _deviceEnumerator.EnumerateAudioEndPoints(DataFlow.Capture, DeviceState.Active);
public static void Start()
foreach (var captureDevice in captureDevices)
{
_manualResetEvent = new ManualResetEvent(false);
_logger.Information("Capture device: {name}", captureDevice.DeviceFriendlyName);
var thread = new Thread(delegate ()
{
var deviceEnumerator = new MMDeviceEnumerator();
foreach (var device in deviceEnumerator.EnumAudioEndpoints(DataFlow.Capture, DeviceState.Active))
{
var sessionManager = AudioSessionManager2.FromMMDevice(device);
var sessionEnumerator = sessionManager.GetSessionEnumerator();
sessionManager.SessionCreated += (sessionSender, sessionCreatedEventArgs) => HandleDeviceSession(device, sessionCreatedEventArgs.NewSession);
foreach (var audioSessionControl in sessionEnumerator)
{
HandleDeviceSession(device, audioSessionControl);
}
}
_manualResetEvent.WaitOne();
});
thread.SetApartmentState(ApartmentState.MTA);
thread.Start();
}
private static void HandleDeviceSession(MMDevice device, AudioSessionControl audioSessionControl)
{
var deviceId = device.DeviceID + audioSessionControl.GroupingParam;
if (!ActiveSessions.ContainsKey(deviceId))
ActiveSessions[deviceId] = 0;
HandleAudioStateChanged(deviceId, audioSessionControl.SessionState);
audioSessionControl.StateChanged += (sender, sessionStateChangedEventArgs) =>
HandleAudioStateChanged(deviceId, sessionStateChangedEventArgs.NewState);
}
public static void Stop()
{
_manualResetEvent?.Set();
}
private static void HandleAudioStateChanged(string deviceId, AudioSessionState newState)
{
switch (newState)
{
case AudioSessionState.AudioSessionStateActive:
ActiveSessions[deviceId]++;
break;
case AudioSessionState.AudioSessionStateInactive:
if (ActiveSessions[deviceId] > 0)
ActiveSessions[deviceId]--;
break;
case AudioSessionState.AudioSessionStateExpired:
break;
default:
throw new ArgumentOutOfRangeException();
}
MicrophoneInUseChanged?.Invoke(MicrophoneInUse());
}
public static bool MicrophoneInUse()
{
return ActiveSessions.Any(a => a.Value > 0);
HandleAddedDevice(captureDevice);
}
}
}
private void HandleAddedDevice(MMDevice captureDevice)
{
_logger.Information("Device added: {name}", captureDevice.DeviceFriendlyName);
var audioDevice = new AudioDevice(captureDevice);
audioDevice.AudioSessionsChanged += AudioDevice_AudioSessionsChanged;
_inputDevices[captureDevice.ID] = audioDevice;
MicrophoneInUseChanged?.Invoke(MicrophoneInUse());
}
private void AudioDevice_AudioSessionsChanged()
{
MicrophoneInUseChanged?.Invoke(MicrophoneInUse());
}
private void HandleRemovedDevice(string deviceId)
{
_logger.Information("Device removed: {id}", deviceId);
_inputDevices.Remove(deviceId);
MicrophoneInUseChanged?.Invoke(MicrophoneInUse());
}
public void Stop()
{
_logger.Information("Stop");
_deviceEnumerator.UnregisterEndpointNotificationCallback(this);
_deviceEnumerator.Dispose();
}
public bool MicrophoneInUse()
{
var totalActiveSessionCount = _inputDevices.Sum(i => i.Value.ActiveSessionCount);
return totalActiveSessionCount > 0;
}
void IMMNotificationClient.OnDeviceStateChanged(string deviceId, DeviceState newState)
{
_logger.Information("OnDeviceStateChanged: {deviceId} {newState}", deviceId, newState);
}
void IMMNotificationClient.OnDeviceAdded(string deviceId)
{
_logger.Information("OnDeviceAdded: {deviceId}", deviceId);
var device = _deviceEnumerator.GetDevice(deviceId);
if (device.DataFlow is DataFlow.Capture or DataFlow.All)
{
HandleAddedDevice(device);
}
}
void IMMNotificationClient.OnDeviceRemoved(string deviceId)
{
_logger.Information("OnDeviceRemoved: {deviceId}", deviceId);
HandleRemovedDevice(deviceId);
}
void IMMNotificationClient.OnDefaultDeviceChanged(DataFlow flow, Role role, string defaultDeviceId)
{
_logger.Information("OnDefaultDeviceChanged: {defaultDeviceId} {flow} {role}", defaultDeviceId, flow, role);
}
void IMMNotificationClient.OnPropertyValueChanged(string pwstrDeviceId, PropertyKey key)
{
_logger.Debug("OnPropertyValueChanged: {deviceId} {propertyId}", pwstrDeviceId, key.propertyId);
}
}
Submodule Common deleted from 6f528f7b59
Submodule Common.Wpf deleted from 8a82786166
+1 -1
View File
@@ -4,7 +4,7 @@ using System.Windows.Forms;
namespace WorkIndicator.Delcom
{
sealed internal partial class DeviceManagement
internal sealed partial class DeviceManagement
{
/// <summary>
/// Compares two device path names. Used to find out if the device name
+15 -16
View File
@@ -1,11 +1,13 @@
using Common.Extensions;
using System;
using System;
using System.Diagnostics;
using Serilog;
namespace WorkIndicator.Delcom
{
public class StoplightIndicator : IDisposable
{
private readonly ILogger _logger;
public enum Light
{
Green,
@@ -20,29 +22,26 @@ namespace WorkIndicator.Delcom
Blink
}
private readonly Delcom _delcom;
private LightState _green = LightState.Off;
private LightState _yellow = LightState.Off;
private LightState _red = LightState.Off;
public StoplightIndicator()
{
_delcom = new Delcom();
_delcom.Open();
_logger = Log.ForContext<StoplightIndicator>();
Device = new Delcom();
Device.Open();
SetLights(_red, _yellow, _green);
}
public void Dispose()
{
_delcom.Close();
Device.Close();
}
public Delcom Device
{
get { return _delcom; }
}
public Delcom Device { get; }
public void GetLights(out LightState red, out LightState yellow, out LightState green)
{
@@ -65,7 +64,7 @@ namespace WorkIndicator.Delcom
return _green;
default:
throw new ArgumentOutOfRangeException("light");
throw new ArgumentOutOfRangeException(nameof(light));
}
}
@@ -80,13 +79,13 @@ namespace WorkIndicator.Delcom
_yellow = yellow;
_green = green;
Debug.WriteLine($"Red: {_red}, Yellow: {_yellow}, Green: {_green}");
_logger.Information("Red: {red}, Yellow: {yellow}, Green: {green}", _red, _yellow, _green);
port1 = port1.SetBitValue((int) Light.Green, green == LightState.Off);
port1 = port1.SetBitValue((int) Light.Yellow, yellow == LightState.Off);
port1 = port1.SetBitValue((int) Light.Red, red == LightState.Off);
_delcom.WritePorts(0, port1);
Device.WritePorts(0, port1);
var blinkEnable = 0;
var blinkDisable = 0;
@@ -106,7 +105,7 @@ namespace WorkIndicator.Delcom
else
blinkDisable = blinkDisable.SetBitValue((int) Light.Green, true);
_delcom.WriteBlink(blinkDisable, blinkEnable);
Device.WriteBlink(blinkDisable, blinkEnable);
}
public void SetLight(Light light, LightState state)
@@ -130,7 +129,7 @@ namespace WorkIndicator.Delcom
break;
default:
throw new ArgumentOutOfRangeException("light");
throw new ArgumentOutOfRangeException(nameof(light));
}
SetLights(red, yellow, green);
+17
View File
@@ -0,0 +1,17 @@
namespace WorkIndicator;
public static class Extensions
{
extension(int i)
{
public int SetBitValue(int bit, bool value)
{
if (value)
i |= 1 << bit;
else
i &= ~(1 << bit);
return i;
}
}
}
+1 -1
View File
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2018 Chris Kaczor
Copyright (c) 2026 Chris Kaczor
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
+44 -21
View File
@@ -14,21 +14,42 @@ namespace WorkIndicator
public static class LightController
{
private static readonly AudioWatcher AudioWatcher = new();
private static StoplightIndicator _stoplightIndicator;
private static UsbService _usbService;
private static bool _initialized;
private static Status _status = Status.Auto;
public static void Initialize()
{
_usbService = new UsbService();
_usbService.DevicesChanged += DevicesChanged;
_stoplightIndicator = new StoplightIndicator();
_stoplightIndicator.SetLight(StoplightIndicator.Light.Yellow, StoplightIndicator.LightState.On);
Properties.Settings.Default.PropertyChanged += HandleSettingChange;
AudioWatcher.MicrophoneInUseChanged += AudioWatcher_MicrophoneInUseChanged;
AudioWatcher.Start();
_initialized = true;
}
private static void HandleSettingChange(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName == nameof(Properties.Settings.Default.DefaultStatus))
UpdateLights();
}
private static void DevicesChanged()
{
_stoplightIndicator?.Dispose();
_stoplightIndicator = new StoplightIndicator();
UpdateLights();
}
private static void AudioWatcher_MicrophoneInUseChanged(bool microphoneInUse)
{
UpdateLights();
@@ -44,6 +65,8 @@ namespace WorkIndicator
_stoplightIndicator.SetLights(StoplightIndicator.LightState.Off, StoplightIndicator.LightState.Off, StoplightIndicator.LightState.Off);
_stoplightIndicator.Dispose();
_usbService.Dispose();
_initialized = false;
}
@@ -63,36 +86,36 @@ namespace WorkIndicator
var yellow = StoplightIndicator.LightState.Off;
var green = StoplightIndicator.LightState.Off;
if (_status == Status.Auto)
var status = _status;
if (status == Status.Auto)
{
if (AudioWatcher.MicrophoneInUse())
{
red = StoplightIndicator.LightState.On;
status = Status.OnPhone;
}
else
{
yellow = StoplightIndicator.LightState.On;
status = (Status) Enum.Parse(typeof(Status), Properties.Settings.Default.DefaultStatus);
}
}
else
switch (status)
{
switch (_status)
{
case Status.Free:
green = StoplightIndicator.LightState.On;
break;
case Status.Working:
yellow = StoplightIndicator.LightState.On;
break;
case Status.OnPhone:
red = StoplightIndicator.LightState.On;
break;
case Status.Talking:
red = StoplightIndicator.LightState.Blink;
break;
default:
throw new ArgumentOutOfRangeException();
}
case Status.Free:
green = StoplightIndicator.LightState.On;
break;
case Status.Working:
yellow = StoplightIndicator.LightState.On;
break;
case Status.OnPhone:
red = StoplightIndicator.LightState.On;
break;
case Status.Talking:
red = StoplightIndicator.LightState.Blink;
break;
default:
throw new ArgumentOutOfRangeException();
}
_stoplightIndicator.SetLights(red, yellow, green);
+107
View File
@@ -0,0 +1,107 @@
using ChrisKaczor.Wpf.Windows;
using H.NotifyIcon;
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
using WorkIndicator.Properties;
using WorkIndicator.SettingsWindow;
namespace WorkIndicator;
internal static class NotificationIcon
{
private static TaskbarIcon _notificationIcon;
private static readonly Dictionary<Status, MenuItem> StatusMenuItems = new();
public static void Initialize()
{
// Create the notification icon
_notificationIcon = new TaskbarIcon { Icon = Resources.ApplicationIcon };
// Set up the menu
var contextMenu = new ContextMenu();
contextMenu.Opened += HandleContextMenuOpening;
AddStatusMenuItem(contextMenu, Resources.StatusAuto, Status.Auto);
AddStatusMenuItem(contextMenu, Resources.StatusFree, Status.Free);
AddStatusMenuItem(contextMenu, Resources.StatusWorking, Status.Working);
AddStatusMenuItem(contextMenu, Resources.StatusOnPhone, Status.OnPhone);
AddStatusMenuItem(contextMenu, Resources.StatusTalking, Status.Talking);
contextMenu.Items.Add(new Separator());
var menuItem = new MenuItem
{
Header = Resources.NotificationIconContextMenuSettings
};
menuItem.Click += ShowSettings;
contextMenu.Items.Add(menuItem);
contextMenu.Items.Add(new Separator());
menuItem = new MenuItem
{
Header = Resources.NotificationIconContextMenuExit
};
menuItem.Click += HandleContextMenuExitClick;
contextMenu.Items.Add(menuItem);
// Set the menu into the icon
_notificationIcon.ContextMenu = contextMenu;
// Show the icon
_notificationIcon.ForceCreate(false);
}
private static void ShowSettings(object sender, RoutedEventArgs e)
{
var categoryPanels = new List<CategoryPanelBase>
{
new GeneralSettingsPanel(),
new UpdateSettingsPanel(),
new AboutSettingsPanel()
};
var settingsWindow = new CategoryWindow(categoryPanels, Resources.SettingsTitle, Resources.CloseButtonText);
settingsWindow.ShowDialog();
}
private static void HandleContextMenuOpening(object sender, RoutedEventArgs e)
{
foreach (var menuItem in StatusMenuItems)
{
menuItem.Value.IsChecked = menuItem.Key == LightController.Status;
}
}
private static void HandleContextMenuExitClick(object sender, System.EventArgs e)
{
Application.Current.Shutdown();
}
public static void Dispose()
{
// Get rid of the icon
_notificationIcon?.Dispose();
_notificationIcon = null;
}
public static void ShowBalloonTip(string text, H.NotifyIcon.Core.NotificationIcon icon)
{
_notificationIcon.ShowNotification(Resources.ApplicationName, text, icon);
}
private static void AddStatusMenuItem(ContextMenu contextMenu, string text, Status status)
{
var menuItem = new MenuItem
{
Header = text,
IsCheckable = true,
IsChecked = status == LightController.Status
};
menuItem.Click += (_, _) => LightController.Status = status;
contextMenu.Items.Add(menuItem);
StatusMenuItems[status] = menuItem;
}
}
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="globalPackagesFolder" value=".\packages" />
</config>
</configuration>
-24
View File
@@ -1,24 +0,0 @@
<windows:CategoryPanel x:Class="WorkIndicator.Options.AboutOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:windows="clr-namespace:Common.Wpf.Windows;assembly=Common.Wpf"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300">
<Grid>
<TextBlock Text="[Application Name]"
Name="ApplicationNameLabel"
VerticalAlignment="Top"
FontWeight="Bold" />
<TextBlock Text="[Application Version]"
Margin="0,22,0,0"
Name="VersionLabel"
VerticalAlignment="Top" />
<TextBlock Text="[Company]"
Margin="0,44,0,0"
Name="CompanyLabel"
VerticalAlignment="Top" />
</Grid>
</windows:CategoryPanel>
-36
View File
@@ -1,36 +0,0 @@
using Common.Update;
using System.Reflection;
namespace WorkIndicator.Options
{
public partial class AboutOptionsPanel
{
public AboutOptionsPanel()
{
InitializeComponent();
}
public override void LoadPanel(object data)
{
base.LoadPanel(data);
ApplicationNameLabel.Text = Properties.Resources.ApplicationName;
var version = UpdateCheck.LocalVersion.ToString();
VersionLabel.Text = string.Format(Properties.Resources.About_Version, version);
CompanyLabel.Text = ((AssemblyCompanyAttribute)Assembly.GetEntryAssembly().GetCustomAttributes(typeof(AssemblyCompanyAttribute), false)[0]).Company;
}
public override bool ValidatePanel()
{
return true;
}
public override void SavePanel()
{
}
public override string CategoryName => Properties.Resources.OptionCategory_About;
}
}
-22
View File
@@ -1,22 +0,0 @@
<windows:CategoryPanel x:Class="WorkIndicator.Options.GeneralOptionsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:windows="clr-namespace:Common.Wpf.Windows;assembly=Common.Wpf"
xmlns:properties="clr-namespace:WorkIndicator.Properties"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<CheckBox Content="{x:Static properties:Resources.StartWithWindows}"
Name="StartWithWindows"
VerticalAlignment="Top"
VerticalContentAlignment="Center"
Grid.ColumnSpan="2" />
</Grid>
</windows:CategoryPanel>
-39
View File
@@ -1,39 +0,0 @@
using Common.Wpf.Extensions;
using System.Windows;
namespace WorkIndicator.Options
{
public partial class GeneralOptionsPanel
{
public GeneralOptionsPanel()
{
InitializeComponent();
}
public override void LoadPanel(object data)
{
base.LoadPanel(data);
var settings = Properties.Settings.Default;
StartWithWindows.IsChecked = settings.StartWithWindows;
}
public override bool ValidatePanel()
{
return true;
}
public override void SavePanel()
{
var settings = Properties.Settings.Default;
if (StartWithWindows.IsChecked.HasValue && settings.StartWithWindows != StartWithWindows.IsChecked.Value)
settings.StartWithWindows = StartWithWindows.IsChecked.Value;
Application.Current.SetStartWithWindows(settings.StartWithWindows);
}
public override string CategoryName => Properties.Resources.OptionCategory_General;
}
}
+30
View File
@@ -0,0 +1,30 @@
using Microsoft.Extensions.Logging;
using Serilog;
using System;
using Velopack;
namespace WorkIndicator;
internal static class Program
{
[STAThread]
public static void Main(string[] args)
{
Log.Logger = new LoggerConfiguration()
.WriteTo.File("log.txt")
.WriteTo.Debug(outputTemplate: "{Timestamp:u} [{Level}] ({SourceContext}) {Message}{NewLine}{Exception}")
.CreateLogger();
Log.Logger.Information("Start");
var loggerFactory = new LoggerFactory().AddSerilog(Log.Logger);
VelopackApp.Build().Run(loggerFactory.CreateLogger("Install"));
var app = new App();
app.InitializeComponent();
app.Run();
Log.Logger.Information("End");
}
}
+43 -5
View File
@@ -1,21 +1,59 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WorkIndicator")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Chris Kaczor")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WorkIndicator")]
[assembly: AssemblyCopyright("Copyright © Chris Kaczor 2012")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: SupportedOSPlatform("windows7.0")]
[assembly: NeutralResourcesLanguage("en-US")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyMetadata("SquirrelAwareVersion", "1")]
+114 -210
View File
@@ -19,7 +19,7 @@ namespace WorkIndicator.Properties {
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
public class Resources {
@@ -60,33 +60,6 @@ namespace WorkIndicator.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Version: {0}.
/// </summary>
public static string About_Version {
get {
return ResourceManager.GetString("About_Version", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add.
/// </summary>
public static string AddWindowPattern {
get {
return ResourceManager.GetString("AddWindowPattern", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add Window Pattern.
/// </summary>
public static string AddWindowPattern_ToolTip {
get {
return ResourceManager.GetString("AddWindowPattern_ToolTip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
@@ -107,11 +80,11 @@ namespace WorkIndicator.Properties {
}
/// <summary>
/// Looks up a localized string similar to Auto.
/// Looks up a localized string similar to Free.
/// </summary>
public static string Auto {
public static string B {
get {
return ResourceManager.GetString("Auto", resourceCulture);
return ResourceManager.GetString("B", resourceCulture);
}
}
@@ -134,47 +107,47 @@ namespace WorkIndicator.Properties {
}
/// <summary>
/// Looks up a localized string similar to Enabled.
/// Looks up a localized string similar to _Check for Update.
/// </summary>
public static string ColumnHeader_Enabled {
public static string CheckUpdate {
get {
return ResourceManager.GetString("ColumnHeader_Enabled", resourceCulture);
return ResourceManager.GetString("CheckUpdate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Name.
/// Looks up a localized string similar to Check _Now.
/// </summary>
public static string ColumnHeader_Name {
public static string checkVersionNowButton {
get {
return ResourceManager.GetString("ColumnHeader_Name", resourceCulture);
return ResourceManager.GetString("checkVersionNowButton", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Pattern.
/// Looks up a localized string similar to _Check for a new version on startup.
/// </summary>
public static string ColumnHeader_Pattern {
public static string checkVersionOnStartupCheckBox {
get {
return ResourceManager.GetString("ColumnHeader_Pattern", resourceCulture);
return ResourceManager.GetString("checkVersionOnStartupCheckBox", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Delete.
/// Looks up a localized string similar to Close.
/// </summary>
public static string DeleteWindowPattern {
public static string CloseButtonText {
get {
return ResourceManager.GetString("DeleteWindowPattern", resourceCulture);
return ResourceManager.GetString("CloseButtonText", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Delete Window Pattern.
/// Looks up a localized string similar to Default status:.
/// </summary>
public static string DeleteWindowPattern_ToolTip {
public static string DefaultStatusLabel {
get {
return ResourceManager.GetString("DeleteWindowPattern_ToolTip", resourceCulture);
return ResourceManager.GetString("DefaultStatusLabel", resourceCulture);
}
}
@@ -187,33 +160,6 @@ namespace WorkIndicator.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to Edit.
/// </summary>
public static string EditWindowPattern {
get {
return ResourceManager.GetString("EditWindowPattern", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Edit Window Pattern.
/// </summary>
public static string EditWindowPattern_ToolTip {
get {
return ResourceManager.GetString("EditWindowPattern_ToolTip", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Free.
/// </summary>
public static string Free {
get {
return ResourceManager.GetString("Free", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Installing update....
/// </summary>
@@ -233,11 +179,20 @@ namespace WorkIndicator.Properties {
}
/// <summary>
/// Looks up a localized string similar to No update found.
/// Looks up a localized string similar to Exit.
/// </summary>
public static string NoUpdate {
public static string NotificationIconContextMenuExit {
get {
return ResourceManager.GetString("NoUpdate", resourceCulture);
return ResourceManager.GetString("NotificationIconContextMenuExit", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Settings....
/// </summary>
public static string NotificationIconContextMenuSettings {
get {
return ResourceManager.GetString("NotificationIconContextMenuSettings", resourceCulture);
}
}
@@ -250,184 +205,133 @@ namespace WorkIndicator.Properties {
}
}
/// <summary>
/// Looks up a localized string similar to On Phone.
/// </summary>
public static string OnPhone {
get {
return ResourceManager.GetString("OnPhone", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to About.
/// </summary>
public static string OptionCategory_About {
public static string optionCategoryAbout {
get {
return ResourceManager.GetString("OptionCategory_About", resourceCulture);
return ResourceManager.GetString("optionCategoryAbout", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to General.
/// </summary>
public static string OptionCategory_General {
public static string optionCategoryGeneral {
get {
return ResourceManager.GetString("OptionCategory_General", resourceCulture);
return ResourceManager.GetString("optionCategoryGeneral", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Window Patterns.
/// Looks up a localized string similar to Update.
/// </summary>
public static string OptionCategory_WindowPatterns {
public static string optionCategoryUpdate {
get {
return ResourceManager.GetString("OptionCategory_WindowPatterns", resourceCulture);
return ResourceManager.GetString("optionCategoryUpdate", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Cancel.
/// Looks up a localized string similar to Settings.
/// </summary>
public static string OptionsWindow_CancelButton {
public static string SettingsTitle {
get {
return ResourceManager.GetString("OptionsWindow_CancelButton", resourceCulture);
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Icon similar to (Icon).
/// </summary>
public static System.Drawing.Icon OptionsWindow_Icon {
get {
object obj = ResourceManager.GetObject("OptionsWindow_Icon", resourceCulture);
return ((System.Drawing.Icon)(obj));
}
}
/// <summary>
/// Looks up a localized string similar to OK.
/// </summary>
public static string OptionsWindow_OkayButton {
get {
return ResourceManager.GetString("OptionsWindow_OkayButton", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Options.
/// </summary>
public static string OptionsWindow_Title {
get {
return ResourceManager.GetString("OptionsWindow_Title", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Restarting application....
/// </summary>
public static string RestartingAfterUpdate {
get {
return ResourceManager.GetString("RestartingAfterUpdate", resourceCulture);
return ResourceManager.GetString("SettingsTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to _Start when Windows starts.
/// </summary>
public static string StartWithWindows {
public static string startWithWindowsCheckBox {
get {
return ResourceManager.GetString("StartWithWindows", resourceCulture);
return ResourceManager.GetString("startWithWindowsCheckBox", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Auto.
/// </summary>
public static string StatusAuto {
get {
return ResourceManager.GetString("StatusAuto", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Free.
/// </summary>
public static string StatusFree {
get {
return ResourceManager.GetString("StatusFree", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to On Phone.
/// </summary>
public static string StatusOnPhone {
get {
return ResourceManager.GetString("StatusOnPhone", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Talking.
/// </summary>
public static string Talking {
public static string StatusTalking {
get {
return ResourceManager.GetString("Talking", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Exit.
/// </summary>
public static string TrayIconContextMenuExit {
get {
return ResourceManager.GetString("TrayIconContextMenuExit", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Options....
/// </summary>
public static string TrayIconContextMenuSettings {
get {
return ResourceManager.GetString("TrayIconContextMenuSettings", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Updating application....
/// </summary>
public static string Updating {
get {
return ResourceManager.GetString("Updating", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to _Enabled:.
/// </summary>
public static string WindowPatternEnabledLabel {
get {
return ResourceManager.GetString("WindowPatternEnabledLabel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to _Name:.
/// </summary>
public static string WindowPatternNameLabel {
get {
return ResourceManager.GetString("WindowPatternNameLabel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to _Pattern:.
/// </summary>
public static string WindowPatternPatternLabel {
get {
return ResourceManager.GetString("WindowPatternPatternLabel", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Add Window Pattern.
/// </summary>
public static string WindowPatternWindowAdd {
get {
return ResourceManager.GetString("WindowPatternWindowAdd", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Edit Window Pattern.
/// </summary>
public static string WindowPatternWindowEdit {
get {
return ResourceManager.GetString("WindowPatternWindowEdit", resourceCulture);
return ResourceManager.GetString("StatusTalking", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Working.
/// </summary>
public static string Working {
public static string StatusWorking {
get {
return ResourceManager.GetString("Working", resourceCulture);
return ResourceManager.GetString("StatusWorking", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to You are already running the most recent version.
///
///No updates are available at this time..
/// </summary>
public static string UpdateCheckCurrent {
get {
return ResourceManager.GetString("UpdateCheckCurrent", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Version {0} is now available.
///
///Would you like to download and install it now?.
/// </summary>
public static string UpdateCheckNewVersion {
get {
return ResourceManager.GetString("UpdateCheckNewVersion", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to {0} Update.
/// </summary>
public static string UpdateCheckTitle {
get {
return ResourceManager.GetString("UpdateCheckTitle", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Version {0}.
/// </summary>
public static string Version {
get {
return ResourceManager.GetString("Version", resourceCulture);
}
}
}
+65 -94
View File
@@ -117,108 +117,58 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="About_Version" xml:space="preserve">
<value>Version: {0}</value>
</data>
<data name="AddWindowPattern" xml:space="preserve">
<value>Add</value>
</data>
<data name="AddWindowPattern_ToolTip" xml:space="preserve">
<value>Add Window Pattern</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="ApplicationIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ApplicationIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<value>..\Resources\Application.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="ApplicationName" xml:space="preserve">
<value>Work Indicator</value>
</data>
<data name="Auto" xml:space="preserve">
<value>Auto</value>
</data>
<data name="CancelButton" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="ColumnHeader_Enabled" xml:space="preserve">
<value>Enabled</value>
</data>
<data name="ColumnHeader_Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="ColumnHeader_Pattern" xml:space="preserve">
<value>Pattern</value>
</data>
<data name="DeleteWindowPattern" xml:space="preserve">
<value>Delete</value>
</data>
<data name="DeleteWindowPattern_ToolTip" xml:space="preserve">
<value>Delete Window Pattern</value>
</data>
<data name="EditWindowPattern" xml:space="preserve">
<value>Edit</value>
</data>
<data name="EditWindowPattern_ToolTip" xml:space="preserve">
<value>Edit Window Pattern</value>
</data>
<data name="Free" xml:space="preserve">
<value>Free</value>
</data>
<data name="OkayButton" xml:space="preserve">
<value>OK</value>
</data>
<data name="OnPhone" xml:space="preserve">
<value>On Phone</value>
</data>
<data name="OptionCategory_About" xml:space="preserve">
<data name="optionCategoryAbout" xml:space="preserve">
<value>About</value>
</data>
<data name="OptionCategory_General" xml:space="preserve">
<value>General</value>
<data name="CheckUpdate" xml:space="preserve">
<value>_Check for Update</value>
</data>
<data name="OptionCategory_WindowPatterns" xml:space="preserve">
<value>Window Patterns</value>
</data>
<data name="OptionsWindow_CancelButton" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="OptionsWindow_Icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\ApplicationIcon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="OptionsWindow_OkayButton" xml:space="preserve">
<value>OK</value>
</data>
<data name="OptionsWindow_Title" xml:space="preserve">
<value>Options</value>
</data>
<data name="StartWithWindows" xml:space="preserve">
<data name="startWithWindowsCheckBox" xml:space="preserve">
<value>_Start when Windows starts</value>
</data>
<data name="Talking" xml:space="preserve">
<value>Talking</value>
<data name="optionCategoryGeneral" xml:space="preserve">
<value>General</value>
</data>
<data name="TrayIconContextMenuExit" xml:space="preserve">
<value>Exit</value>
<data name="SettingsTitle" xml:space="preserve">
<value>Settings</value>
</data>
<data name="TrayIconContextMenuSettings" xml:space="preserve">
<value>Options...</value>
<data name="CloseButtonText" xml:space="preserve">
<value>Close</value>
</data>
<data name="WindowPatternEnabledLabel" xml:space="preserve">
<value>_Enabled:</value>
<data name="Version" xml:space="preserve">
<value>Version {0}</value>
</data>
<data name="WindowPatternNameLabel" xml:space="preserve">
<value>_Name:</value>
<data name="optionCategoryUpdate" xml:space="preserve">
<value>Update</value>
</data>
<data name="WindowPatternPatternLabel" xml:space="preserve">
<value>_Pattern:</value>
<data name="checkVersionOnStartupCheckBox" xml:space="preserve">
<value>_Check for a new version on startup</value>
</data>
<data name="WindowPatternWindowAdd" xml:space="preserve">
<value>Add Window Pattern</value>
<data name="checkVersionNowButton" xml:space="preserve">
<value>Check _Now</value>
</data>
<data name="WindowPatternWindowEdit" xml:space="preserve">
<value>Edit Window Pattern</value>
<data name="UpdateCheckTitle" xml:space="preserve">
<value>{0} Update</value>
</data>
<data name="Working" xml:space="preserve">
<value>Working</value>
<data name="UpdateCheckCurrent" xml:space="preserve">
<value>You are already running the most recent version.
No updates are available at this time.</value>
</data>
<data name="UpdateCheckNewVersion" xml:space="preserve">
<value>Version {0} is now available.
Would you like to download and install it now?</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Loading...</value>
</data>
<data name="CheckingForUpdate" xml:space="preserve">
<value>Checking for update...</value>
@@ -226,19 +176,40 @@
<data name="DownloadingUpdate" xml:space="preserve">
<value>Downloading update...</value>
</data>
<data name="NoUpdate" xml:space="preserve">
<value>No update found</value>
</data>
<data name="Updating" xml:space="preserve">
<value>Updating application...</value>
</data>
<data name="RestartingAfterUpdate" xml:space="preserve">
<value>Restarting application...</value>
</data>
<data name="InstallingUpdate" xml:space="preserve">
<value>Installing update...</value>
</data>
<data name="Loading" xml:space="preserve">
<value>Loading...</value>
<data name="OkayButton" xml:space="preserve">
<value>OK</value>
</data>
<data name="CancelButton" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="NotificationIconContextMenuExit" xml:space="preserve">
<value>Exit</value>
</data>
<data name="B" xml:space="preserve">
<value>Free</value>
</data>
<data name="StatusWorking" xml:space="preserve">
<value>Working</value>
</data>
<data name="StatusOnPhone" xml:space="preserve">
<value>On Phone</value>
</data>
<data name="StatusTalking" xml:space="preserve">
<value>Talking</value>
</data>
<data name="NotificationIconContextMenuSettings" xml:space="preserve">
<value>Settings...</value>
</data>
<data name="StatusFree" xml:space="preserve">
<value>Free</value>
</data>
<data name="StatusAuto" xml:space="preserve">
<value>Auto</value>
</data>
<data name="DefaultStatusLabel" xml:space="preserve">
<value>Default status:</value>
</data>
</root>
+33 -27
View File
@@ -12,7 +12,7 @@ namespace WorkIndicator.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.5.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "18.9.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -25,43 +25,49 @@ namespace WorkIndicator.Properties {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool StartWithWindows {
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string WindowSettings {
get {
return ((bool)(this["StartWithWindows"]));
return ((string)(this["WindowSettings"]));
}
set {
this["StartWithWindows"] = value;
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("00:00:10")]
public global::System.TimeSpan RetryInterval {
get {
return ((global::System.TimeSpan)(this["RetryInterval"]));
}
}
[global::System.Configuration.ApplicationScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("00:00:00.5000000")]
public global::System.TimeSpan UpdateInterval {
get {
return ((global::System.TimeSpan)(this["UpdateInterval"]));
this["WindowSettings"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string WindowPatterns {
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool AutoStart {
get {
return ((string)(this["WindowPatterns"]));
return ((bool)(this["AutoStart"]));
}
set {
this["WindowPatterns"] = value;
this["AutoStart"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool CheckVersionAtStartup {
get {
return ((bool)(this["CheckVersionAtStartup"]));
}
set {
this["CheckVersionAtStartup"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Working")]
public string DefaultStatus {
get {
return ((string)(this["DefaultStatus"]));
}
set {
this["DefaultStatus"] = value;
}
}
}
+8 -8
View File
@@ -2,17 +2,17 @@
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="WorkIndicator.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="StartWithWindows" Type="System.Boolean" Scope="User">
<Setting Name="WindowSettings" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="AutoStart" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="RetryInterval" Type="System.TimeSpan" Scope="Application">
<Value Profile="(Default)">00:00:10</Value>
<Setting Name="CheckVersionAtStartup" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="UpdateInterval" Type="System.TimeSpan" Scope="Application">
<Value Profile="(Default)">00:00:00.5000000</Value>
</Setting>
<Setting Name="WindowPatterns" Type="System.String" Scope="User">
<Value Profile="(Default)" />
<Setting Name="DefaultStatus" Type="System.String" Scope="User">
<Value Profile="(Default)">Working</Value>
</Setting>
</Settings>
</SettingsFile>

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

+21
View File
@@ -0,0 +1,21 @@
<windows:CategoryPanelBase x:Class="WorkIndicator.SettingsWindow.AboutSettingsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:properties="clr-namespace:WorkIndicator.Properties"
xmlns:WorkIndicator="clr-namespace:WorkIndicator"
xmlns:windows="clr-namespace:ChrisKaczor.Wpf.Windows;assembly=ChrisKaczor.Wpf.Windows.CategoryWindow"
mc:Ignorable="d"
d:DesignHeight="150"
d:DesignWidth="300">
<Grid>
<StackPanel windows:Spacing.Vertical="10">
<TextBlock Text="{x:Static properties:Resources.ApplicationName}"
FontWeight="Bold" />
<TextBlock Text="{Binding Source={x:Static WorkIndicator:UpdateCheck.LocalVersion}, StringFormat={x:Static properties:Resources.Version}}"
Name="VersionLabel" />
<TextBlock Text="Chris Kaczor" />
</StackPanel>
</Grid>
</windows:CategoryPanelBase>
+12
View File
@@ -0,0 +1,12 @@
namespace WorkIndicator.SettingsWindow
{
public partial class AboutSettingsPanel
{
public AboutSettingsPanel()
{
InitializeComponent();
}
public override string CategoryName => Properties.Resources.optionCategoryAbout;
}
}
+33
View File
@@ -0,0 +1,33 @@
<windows:CategoryPanelBase x:Class="WorkIndicator.SettingsWindow.GeneralSettingsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:properties="clr-namespace:WorkIndicator.Properties"
xmlns:windows="clr-namespace:ChrisKaczor.Wpf.Windows;assembly=ChrisKaczor.Wpf.Windows.CategoryWindow"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
xmlns:workIndicator="clr-namespace:WorkIndicator"
mc:Ignorable="d"
d:DesignHeight="300"
d:DesignWidth="300">
<StackPanel windows:Spacing.Vertical="10">
<CheckBox Content="{x:Static properties:Resources.startWithWindowsCheckBox}"
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=AutoStart}"
Click="OnSaveSettings" />
<ComboBox
mah:TextBoxHelper.UseFloatingWatermark="True"
mah:TextBoxHelper.Watermark="{x:Static properties:Resources.DefaultStatusLabel}"
SelectedValue="{Binding Source={x:Static properties:Settings.Default}, Path=DefaultStatus}"
SelectedValuePath="Tag"
SelectionChanged="OnSaveSettings">
<ComboBoxItem Content="{x:Static properties:Resources.StatusFree}"
Tag="{x:Static workIndicator:Status.Free}" />
<ComboBoxItem Content="{x:Static properties:Resources.StatusWorking}"
Tag="{x:Static workIndicator:Status.Working}" />
<ComboBoxItem Content="{x:Static properties:Resources.StatusOnPhone}"
Tag="{x:Static workIndicator:Status.OnPhone}" />
<ComboBoxItem Content="{x:Static properties:Resources.StatusTalking}"
Tag="{x:Static workIndicator:Status.Talking}" />
</ComboBox>
</StackPanel>
</windows:CategoryPanelBase>
@@ -0,0 +1,36 @@
using ChrisKaczor.Wpf.Application;
using System.Windows;
using WorkIndicator.Properties;
namespace WorkIndicator.SettingsWindow;
public partial class GeneralSettingsPanel
{
public GeneralSettingsPanel()
{
InitializeComponent();
}
public override string CategoryName => Properties.Resources.optionCategoryGeneral;
public override void LoadPanel(Window parentWindow)
{
base.LoadPanel(parentWindow);
MarkLoaded();
}
private void OnSaveSettings(object sender, RoutedEventArgs e)
{
SaveSettings();
}
private void SaveSettings()
{
if (!HasLoaded) return;
Settings.Default.Save();
Application.Current.SetStartWithWindows(Settings.Default.AutoStart);
}
}
+22
View File
@@ -0,0 +1,22 @@
<windows:CategoryPanelBase x:Class="WorkIndicator.SettingsWindow.UpdateSettingsPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:properties="clr-namespace:WorkIndicator.Properties"
xmlns:windows="clr-namespace:ChrisKaczor.Wpf.Windows;assembly=ChrisKaczor.Wpf.Windows.CategoryWindow"
xmlns:WorkIndicator="clr-namespace:WorkIndicator"
mc:Ignorable="d"
d:DesignHeight="150"
d:DesignWidth="250">
<StackPanel windows:Spacing.Vertical="10">
<CheckBox Content="{x:Static properties:Resources.checkVersionOnStartupCheckBox}"
Name="CheckVersionOnStartupCheckBox"
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=CheckVersionAtStartup}"
Click="OnSaveSettings" />
<Button Content="{x:Static properties:Resources.checkVersionNowButton}"
IsEnabled="{Binding Source={x:Static WorkIndicator:UpdateCheck.IsInstalled}}"
HorizontalAlignment="Left"
Click="HandleCheckVersionNowButtonClick" />
</StackPanel>
</windows:CategoryPanelBase>
@@ -0,0 +1,38 @@
using System.Windows;
using System.Windows.Input;
using WorkIndicator.Properties;
namespace WorkIndicator.SettingsWindow;
public partial class UpdateSettingsPanel
{
public UpdateSettingsPanel()
{
InitializeComponent();
}
public override string CategoryName => Properties.Resources.optionCategoryUpdate;
private async void HandleCheckVersionNowButtonClick(object sender, RoutedEventArgs e)
{
var cursor = Cursor;
Cursor = Cursors.Wait;
await UpdateCheck.DisplayUpdateInformation(true);
Cursor = cursor;
}
private void OnSaveSettings(object sender, RoutedEventArgs e)
{
SaveSettings();
}
private void SaveSettings()
{
if (!HasLoaded) return;
Settings.Default.Save();
}
}
-142
View File
@@ -1,142 +0,0 @@
using Common.Wpf.Windows;
using System.Collections.Generic;
using System.Windows.Forms;
using WorkIndicator.Options;
using WorkIndicator.Properties;
using Application = System.Windows.Application;
namespace WorkIndicator
{
internal static class TrayIcon
{
private static NotifyIcon _trayIcon;
private static bool _initialized;
private static CategoryWindow _optionsWindow;
public static void Initialize()
{
// Create the tray icon
_trayIcon = new NotifyIcon { Icon = Resources.ApplicationIcon, Text = Resources.ApplicationName };
// Setup the menu
var contextMenuStrip = new ContextMenuStrip();
contextMenuStrip.Opening += HandleContextMenuStripOpening;
// Add the menu items
var menuItem = new ToolStripMenuItem(Resources.Auto, null, HandleStatusMenuClick) { Tag = Status.Auto };
contextMenuStrip.Items.Add(menuItem);
// --
menuItem = new ToolStripMenuItem(Resources.Free, null, HandleStatusMenuClick) { Tag = Status.Free };
contextMenuStrip.Items.Add(menuItem);
// --
menuItem = new ToolStripMenuItem(Resources.Working, null, HandleStatusMenuClick) { Tag = Status.Working };
contextMenuStrip.Items.Add(menuItem);
// --
menuItem = new ToolStripMenuItem(Resources.OnPhone, null, HandleStatusMenuClick) { Tag = Status.OnPhone };
contextMenuStrip.Items.Add(menuItem);
// --
menuItem = new ToolStripMenuItem(Resources.Talking, null, HandleStatusMenuClick) { Tag = Status.Talking };
contextMenuStrip.Items.Add(menuItem);
// --
contextMenuStrip.Items.Add("-");
contextMenuStrip.Items.Add(Resources.TrayIconContextMenuSettings, null, HandleContextMenuSettingsClick);
// --
contextMenuStrip.Items.Add("-");
contextMenuStrip.Items.Add(Resources.TrayIconContextMenuExit, null, HandleContextMenuExitClick);
// Set the menu into the icon
_trayIcon.ContextMenuStrip = contextMenuStrip;
// Show the icon
_trayIcon.Visible = true;
_initialized = true;
}
public static void SetText(string text)
{
_trayIcon.Text = text;
}
static void HandleContextMenuStripOpening(object sender, System.ComponentModel.CancelEventArgs e)
{
foreach (ToolStripItem menuItem in _trayIcon.ContextMenuStrip.Items)
{
if (menuItem.Tag == null)
continue;
var status = (Status)menuItem.Tag;
((ToolStripMenuItem)menuItem).Checked = (LightController.Status == status);
}
}
private static void HandleStatusMenuClick(object sender, System.EventArgs e)
{
var menuItem = (ToolStripMenuItem)sender;
var status = (Status)menuItem.Tag;
LightController.Status = status;
}
private static void HandleContextMenuSettingsClick(object sender, System.EventArgs e)
{
ShowSettings();
}
private static void HandleContextMenuExitClick(object sender, System.EventArgs e)
{
// Shutdown the application
Application.Current.Shutdown();
}
public static void Dispose()
{
if (!_initialized)
return;
// Get rid of the icon
_trayIcon.Visible = false;
_trayIcon.Dispose();
_initialized = false;
}
private static void ShowSettings()
{
var panels = new List<CategoryPanel>
{
new GeneralOptionsPanel(),
new AboutOptionsPanel()
};
if (_optionsWindow == null)
{
_optionsWindow = new CategoryWindow(null, panels, Resources.ResourceManager, "OptionsWindow");
_optionsWindow.Closed += (o, args) => { _optionsWindow = null; };
}
var dialogResult = _optionsWindow.ShowDialog();
if (dialogResult.HasValue && dialogResult.Value)
{
}
}
}
}
+39 -60
View File
@@ -1,71 +1,50 @@
using Squirrel;
using System;
using System.Linq;
using System.Net;
using System.Reflection;
using NuGet.Versioning;
using Serilog;
using System.Threading.Tasks;
using System.Windows;
using Velopack;
using Velopack.Sources;
namespace WorkIndicator
namespace WorkIndicator;
internal static class UpdateCheck
{
public static class UpdateCheck
private static UpdateManager _updateManager;
public static UpdateManager UpdateManager => _updateManager ??= new UpdateManager(new GiteaSource("https://gitea.kaczorzoo.net/ckaczor/WorkIndicator", null, false));
public static string LocalVersion => (UpdateManager.CurrentVersion ?? new SemanticVersion(0, 0, 0)).ToString();
public static bool IsInstalled => UpdateManager.IsInstalled;
public static async Task DisplayUpdateInformation(bool showIfCurrent)
{
public enum UpdateStatus
var newVersion = IsInstalled ? await UpdateManager.CheckForUpdatesAsync() : null;
if (newVersion != null)
{
Checking,
None,
Downloading,
Installing,
Restarting
var updateCheckTitle = string.Format(Properties.Resources.UpdateCheckTitle, Properties.Resources.ApplicationName);
var updateCheckMessage = string.Format(Properties.Resources.UpdateCheckNewVersion, newVersion.TargetFullRelease.Version);
if (MessageBox.Show(updateCheckMessage, updateCheckTitle, MessageBoxButton.YesNo, MessageBoxImage.Question) != MessageBoxResult.Yes)
return;
Log.Logger.Information("Downloading update");
await UpdateManager.DownloadUpdatesAsync(newVersion);
Log.Logger.Information("Installing update");
UpdateManager.ApplyUpdatesAndRestart(newVersion);
}
public delegate void UpdateStatusDelegate(UpdateStatus updateStatus, string message);
public static Version LocalVersion => Assembly.GetEntryAssembly().GetName().Version;
public static async Task<bool> CheckUpdate(UpdateStatusDelegate onUpdateStatus)
else if (showIfCurrent)
{
try
{
onUpdateStatus.Invoke(UpdateStatus.Checking, Properties.Resources.CheckingForUpdate);
var updateCheckTitle = string.Format(Properties.Resources.UpdateCheckTitle, Properties.Resources.ApplicationName);
ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
var updateCheckMessage = string.Format(Properties.Resources.UpdateCheckCurrent, Properties.Resources.ApplicationName);
using (var updateManager = await UpdateManager.GitHubUpdateManager(App.UpdateUrl))
{
var updates = await updateManager.CheckForUpdate();
var lastVersion = updates?.ReleasesToApply?.OrderBy(releaseEntry => releaseEntry.Version).LastOrDefault();
if (lastVersion == null)
{
onUpdateStatus.Invoke(UpdateStatus.None, Properties.Resources.NoUpdate);
return false;
}
onUpdateStatus.Invoke(UpdateStatus.Downloading, Properties.Resources.DownloadingUpdate);
Common.Settings.Extensions.BackupSettings();
await updateManager.DownloadReleases(new[] { lastVersion });
onUpdateStatus.Invoke(UpdateStatus.Installing, Properties.Resources.InstallingUpdate);
await updateManager.ApplyReleases(updates);
await updateManager.UpdateApp();
}
onUpdateStatus.Invoke(UpdateStatus.Restarting, Properties.Resources.RestartingAfterUpdate);
UpdateManager.RestartApp();
return true;
}
catch (Exception exception)
{
Console.WriteLine(exception);
return false;
}
MessageBox.Show(updateCheckMessage, updateCheckTitle, MessageBoxButton.OK, MessageBoxImage.Information);
}
}
}
}
+50
View File
@@ -0,0 +1,50 @@
using System;
using System.Windows.Forms;
namespace WorkIndicator;
internal class UsbService : NativeWindow, IDisposable
{
public event Action DevicesChanged;
private const int WmDeviceChange = 0x0219;
private const int DbtDeviceArrival = 0x8000;
private const int DbtDeviceRemoveComplete = 0x8004;
private const int DbtDevNodesChanged = 0x0007;
private bool _isDisposed;
internal UsbService()
{
base.CreateHandle(new CreateParams());
}
protected override void WndProc(ref Message msg)
{
base.WndProc(ref msg);
if (msg.Msg != WmDeviceChange)
return;
switch (msg.WParam.ToInt32())
{
case DbtDevNodesChanged:
case DbtDeviceArrival:
case DbtDeviceRemoveComplete:
DevicesChanged?.Invoke();
break;
}
}
public void Dispose()
{
if (_isDisposed)
return;
base.DestroyHandle();
_isDisposed = true;
GC.SuppressFinalize(this);
}
}
+60 -258
View File
@@ -1,259 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WorkIndicator</RootNamespace>
<AssemblyName>WorkIndicator</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisLogFile>bin\Debug\WorkIndicator.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>true</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisLogFile>bin\Release\WorkIndicator.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<CodeAnalysisIgnoreBuiltInRules>true</CodeAnalysisIgnoreBuiltInRules>
<CodeAnalysisFailOnMissingRules>false</CodeAnalysisFailOnMissingRules>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisLogFile>bin\Debug\WorkIndicator.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<CodeAnalysisLogFile>bin\Release\WorkIndicator.exe.CodeAnalysisLog.xml</CodeAnalysisLogFile>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSetDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\\Rule Sets</CodeAnalysisRuleSetDirectories>
<CodeAnalysisIgnoreBuiltInRuleSets>false</CodeAnalysisIgnoreBuiltInRuleSets>
<CodeAnalysisRuleDirectories>;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Team Tools\Static Analysis Tools\FxCop\\Rules</CodeAnalysisRuleDirectories>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>Resources\ApplicationIcon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="UpdateCheck.cs" />
<Page Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="AudioWatcher.cs" />
<Compile Include="LightController.cs" />
<Compile Include="Delcom\StoplightIndicator.cs" />
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="Delcom\Delcom.cs" />
<Compile Include="Delcom\DeviceManagement.cs" />
<Compile Include="Delcom\DeviceManagementDeclarations.cs" />
<Compile Include="Delcom\FileIODeclarations.cs" />
<Compile Include="Delcom\HID.cs" />
<Compile Include="Delcom\HIDDeclarations.cs" />
<Compile Include="Options\AboutOptionsPanel.xaml.cs">
<DependentUpon>AboutOptionsPanel.xaml</DependentUpon>
</Compile>
<Compile Include="Options\GeneralOptionsPanel.xaml.cs">
<DependentUpon>GeneralOptionsPanel.xaml</DependentUpon>
</Compile>
<Compile Include="TrayIcon.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="app.config" />
<None Include="appveyor.yml" />
<None Include="LICENSE.md" />
<None Include="NuGet.config" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
<None Include="README.md" />
<None Include="WorkIndicator.nuspec" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\ApplicationIcon.ico" />
</ItemGroup>
<ItemGroup>
<Content Include=".gitignore" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="Common.Wpf\Common.Native\Common.Native.csproj">
<Project>{ed1c07a1-54f5-4796-8b06-2a0bb1960d84}</Project>
<Name>Common.Native</Name>
</ProjectReference>
<ProjectReference Include="Common.Wpf\Common.Wpf.csproj">
<Project>{0074c983-550e-4094-9e8c-f566fb669297}</Project>
<Name>Common.Wpf</Name>
</ProjectReference>
<ProjectReference Include="Common\Common.csproj">
<Project>{17864d82-457d-4a0a-bc10-1d07f2b3a5d6}</Project>
<Name>Common</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Page Include="Options\AboutOptionsPanel.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Options\GeneralOptionsPanel.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="CSCore">
<Version>1.2.1.2</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>13.0.1</Version>
</PackageReference>
<PackageReference Include="squirrel.windows">
<Version>2.0.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0-windows7.0</TargetFramework>
<OutputType>WinExe</OutputType>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<UseWPF>true</UseWPF>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<StartupObject>WorkIndicator.Program</StartupObject>
<ApplicationIcon>Resources\Application.ico</ApplicationIcon>
<UseWindowsForms>true</UseWindowsForms>
<Platforms>x86</Platforms>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>
<ItemGroup>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\Application.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ChrisKaczor.Wpf.Application.StartWithWindows" Version="1.0.5" />
<PackageReference Include="ChrisKaczor.Wpf.Controls.Link" Version="1.0.4" />
<PackageReference Include="ChrisKaczor.Wpf.Validation" Version="1.0.4" />
<PackageReference Include="ChrisKaczor.Wpf.Windows.CategoryWindow" Version="1.0.2" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.4.1" />
<PackageReference Include="NAudio.Wasapi" Version="2.3.0" />
<PackageReference Include="Serilog" Version="4.0.2" />
<PackageReference Include="Serilog.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="Velopack" Version="0.0.626" />
</ItemGroup>
<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Update="Properties\Settings.Designer.cs">
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<None Update="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include=".gitea\workflows\main.yml" />
</ItemGroup>
<ItemGroup>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
</Project>
-2
View File
@@ -1,2 +0,0 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=Delcom/@EntryIndexedValue">False</s:Boolean></wpf:ResourceDictionary>
-19
View File
@@ -1,19 +0,0 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>WorkIndicator</id>
<title>Work Indicator</title>
<version>$version$</version>
<authors>Chris Kaczor</authors>
<description>Controls a Delcom Green/Yellow/Red Indicator to show work status (free, working, on phone, talking) either manually or automatically.</description>
<projectUrl>https://github.com/ckaczor/WorkIndicator</projectUrl>
<license type="expression">MIT</license>
<tags></tags>
<dependencies>
<group targetFramework=".NETFramework4.5" />
</dependencies>
</metadata>
<files>
<file src="bin\$configuration$\**\*" target="lib\net45" exclude="*.pdb;*.nupkg;*.vshost.*" />
</files>
</package>
+10 -60
View File
@@ -1,79 +1,29 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
# Visual Studio Version 18
VisualStudioVersion = 18.9.12023.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WorkIndicator", "WorkIndicator.csproj", "{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common", "Common\Common.csproj", "{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Wpf", "Common.Wpf\Common.Wpf.csproj", "{0074C983-550E-4094-9E8C-F566FB669297}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Common.Native", "Common.Wpf\Common.Native\Common.Native.csproj", "{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WorkIndicator", "WorkIndicator.csproj", "{B4A9FB98-C873-487F-AC4B-9B4356491DE3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Debug|Any CPU.ActiveCfg = Debug|x86
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Debug|Any CPU.Build.0 = Debug|x86
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Debug|x64.ActiveCfg = Debug|x64
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Debug|x64.Build.0 = Debug|x64
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Debug|x86.ActiveCfg = Debug|x86
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Debug|x86.Build.0 = Debug|x86
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Release|Any CPU.ActiveCfg = Release|x86
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Release|Any CPU.Build.0 = Release|x86
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Release|x64.ActiveCfg = Release|x64
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Release|x64.Build.0 = Release|x64
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Release|x86.ActiveCfg = Release|x86
{A888FD0E-4A0E-4CAA-BC4D-C17D4AFA5715}.Release|x86.Build.0 = Release|x86
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Debug|x64.ActiveCfg = Debug|x64
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Debug|x64.Build.0 = Debug|x64
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Debug|x86.ActiveCfg = Debug|x86
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Debug|x86.Build.0 = Debug|x86
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Release|Any CPU.Build.0 = Release|Any CPU
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Release|x64.ActiveCfg = Release|x64
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Release|x64.Build.0 = Release|x64
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Release|x86.ActiveCfg = Release|x86
{17864D82-457D-4A0A-BC10-1D07F2B3A5D6}.Release|x86.Build.0 = Release|x86
{0074C983-550E-4094-9E8C-F566FB669297}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0074C983-550E-4094-9E8C-F566FB669297}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0074C983-550E-4094-9E8C-F566FB669297}.Debug|x64.ActiveCfg = Debug|x64
{0074C983-550E-4094-9E8C-F566FB669297}.Debug|x64.Build.0 = Debug|x64
{0074C983-550E-4094-9E8C-F566FB669297}.Debug|x86.ActiveCfg = Debug|x86
{0074C983-550E-4094-9E8C-F566FB669297}.Debug|x86.Build.0 = Debug|x86
{0074C983-550E-4094-9E8C-F566FB669297}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0074C983-550E-4094-9E8C-F566FB669297}.Release|Any CPU.Build.0 = Release|Any CPU
{0074C983-550E-4094-9E8C-F566FB669297}.Release|x64.ActiveCfg = Release|x64
{0074C983-550E-4094-9E8C-F566FB669297}.Release|x64.Build.0 = Release|x64
{0074C983-550E-4094-9E8C-F566FB669297}.Release|x86.ActiveCfg = Release|x86
{0074C983-550E-4094-9E8C-F566FB669297}.Release|x86.Build.0 = Release|x86
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|x64.ActiveCfg = Debug|x64
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|x64.Build.0 = Debug|x64
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|x86.ActiveCfg = Debug|x86
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Debug|x86.Build.0 = Debug|x86
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|Any CPU.Build.0 = Release|Any CPU
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|x64.ActiveCfg = Release|x64
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|x64.Build.0 = Release|x64
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|x86.ActiveCfg = Release|x86
{ED1C07A1-54F5-4796-8B06-2A0BB1960D84}.Release|x86.Build.0 = Release|x86
{B4A9FB98-C873-487F-AC4B-9B4356491DE3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4A9FB98-C873-487F-AC4B-9B4356491DE3}.Debug|x86.ActiveCfg = Debug|x86
{B4A9FB98-C873-487F-AC4B-9B4356491DE3}.Debug|x86.Build.0 = Debug|x86
{B4A9FB98-C873-487F-AC4B-9B4356491DE3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B4A9FB98-C873-487F-AC4B-9B4356491DE3}.Release|x86.ActiveCfg = Release|x86
{B4A9FB98-C873-487F-AC4B-9B4356491DE3}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {43D76B6A-4DD4-40CF-BE03-763A12DCFA72}
SolutionGuid = {0F74AA40-5495-496E-8131-A5FEFFFA9097}
EndGlobalSection
EndGlobal
+2 -1
View File
@@ -1,2 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:Boolean x:Key="/Default/UserDictionary/Words/=Delcom/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Delcom/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Kaczor/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
+16 -20
View File
@@ -1,31 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="WorkIndicator.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="WorkIndicator.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="WorkIndicator.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<userSettings>
<WorkIndicator.Properties.Settings>
<setting name="StartWithWindows" serializeAs="String">
<setting name="WindowSettings" serializeAs="String">
<value />
</setting>
<setting name="AutoStart" serializeAs="String">
<value>True</value>
</setting>
<setting name="WindowPatterns" serializeAs="String">
<value />
<setting name="CheckVersionAtStartup" serializeAs="String">
<value>True</value>
</setting>
<setting name="DefaultStatus" serializeAs="String">
<value>Working</value>
</setting>
</WorkIndicator.Properties.Settings>
</userSettings>
<applicationSettings>
<WorkIndicator.Properties.Settings>
<setting name="RetryInterval" serializeAs="String">
<value>00:00:10</value>
</setting>
<setting name="UpdateInterval" serializeAs="String">
<value>00:00:00.5000000</value>
</setting>
</WorkIndicator.Properties.Settings>
</applicationSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1"/></startup></configuration>
</configuration>
-31
View File
@@ -1,31 +0,0 @@
version: 1.0.{build}
pull_requests:
do_not_increment_build_number: true
skip_tags: true
image: Visual Studio 2017
configuration: Release
assembly_info:
patch: true
file: 'Properties\AssemblyInfo.cs'
assembly_version: '{version}'
assembly_file_version: '{version}'
build:
project: WorkIndicator.sln
verbosity: minimal
after_build:
- ps: >-
nuget pack WorkIndicator.nuspec -Version $env:APPVEYOR_BUILD_VERSION -Properties Configuration=Release -OutputDirectory bin\Release\
$squirrel = ".\packages\squirrel.windows\*\tools\Squirrel.exe"
.$squirrel -releasify ".\bin\$env:CONFIGURATION\WorkIndicator.$env:APPVEYOR_BUILD_VERSION.nupkg" | Write-Output
artifacts:
- path: Releases\*
name: Releases
deploy:
- provider: Environment
name: GitHub
install:
- cmd: git submodule update --init --recursive
before_build:
- cmd: nuget restore