Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
91afb61
Modernize project to WPF and .NET 10
lukethehawk Sep 22, 2026
dfa7b4d
Add WPF application shell with system Fluent theme
lukethehawk Sep 22, 2026
3b42794
Add printer model
lukethehawk Sep 22, 2026
55281fc
Refactor native printer interop
lukethehawk Sep 22, 2026
8120079
Add printer management service
lukethehawk Sep 22, 2026
35f71ef
Add network printer diagnostics
lukethehawk Sep 22, 2026
6c67da1
Add robust spooler service
lukethehawk Sep 22, 2026
e79f3c7
Add WPF startup and smart UAC actions
lukethehawk Sep 22, 2026
0b7f9b4
Add modern printer management interface
lukethehawk Sep 22, 2026
7aef8af
Implement printer UI interactions and diagnostics
lukethehawk Sep 22, 2026
f80bb8b
Remove legacy Form1.cs
lukethehawk Sep 22, 2026
9a33977
Remove legacy Form1.resx
lukethehawk Sep 22, 2026
cc12518
Remove legacy PrinterHelper.cs
lukethehawk Sep 22, 2026
6790698
Remove legacy Program.cs
lukethehawk Sep 22, 2026
b4aee3e
Remove legacy PrinterManagerNativeTool.csproj.user
lukethehawk Sep 22, 2026
fcff2a6
Document Printer Manager v2
lukethehawk Sep 22, 2026
c2ba02f
Add Windows build and portable publish workflow
lukethehawk Sep 22, 2026
60e56b3
Remove obsolete v1 screenshot
lukethehawk Sep 22, 2026
6419bb8
Fix spooler filesystem imports
lukethehawk Sep 22, 2026
9bfed2f
Fix native printer buffer lifetime on startup
lukethehawk Sep 22, 2026
b805b20
Refine shared WPF styles
lukethehawk Sep 22, 2026
fe5e095
Polish printer display metadata
lukethehawk Sep 22, 2026
7c34735
Polish Printer Manager v2 interface
lukethehawk Sep 22, 2026
82cc8a0
Wire polished UI and contextual diagnostics
lukethehawk Sep 22, 2026
ca0a7c3
Ship only portable executable artifact
lukethehawk Sep 22, 2026
9c8b13a
Fix DataGrid contrast in dark mode
lukethehawk Sep 22, 2026
51eb9ed
Tighten printer rows and style search field
lukethehawk Sep 22, 2026
0633418
Align printer columns and improve search placeholder
lukethehawk Sep 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build

on:
push:
branches:
- master
- v2-modernization
pull_request:
branches:
- master

permissions:
contents: read

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup .NET 10
uses: actions/setup-dotnet@v4
with:
dotnet-version: 10.0.x

- name: Restore
run: dotnet restore PrinterManagerNativeTool.sln

- name: Build
run: dotnet build PrinterManagerNativeTool.sln -c Release --no-restore

- name: Publish portable x64
run: dotnet publish PrinterManagerNativeTool/PrinterManagerNativeTool.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=true --no-restore -o artifacts/win-x64

- name: Upload portable executable
uses: actions/upload-artifact@v4
with:
name: PrinterManager-win-x64
path: artifacts/win-x64/PrinterManagerNativeTool.exe
if-no-files-found: error
123 changes: 123 additions & 0 deletions PrinterManagerNativeTool/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<Application x:Class="PrinterManagerNativeTool.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ThemeMode="System">
<Application.Resources>
<SolidColorBrush x:Key="PrinterGridBackgroundBrush" Color="#202226"/>
<SolidColorBrush x:Key="PrinterGridRowBrush" Color="#25282D"/>
<SolidColorBrush x:Key="PrinterGridAlternateRowBrush" Color="#292C32"/>
<SolidColorBrush x:Key="PrinterGridHoverBrush" Color="#333740"/>
<SolidColorBrush x:Key="PrinterGridSelectedBrush" Color="#36516B"/>
<SolidColorBrush x:Key="PrinterGridHeaderBrush" Color="#2E3239"/>
<SolidColorBrush x:Key="PrinterGridForegroundBrush" Color="#F2F3F5"/>
<SolidColorBrush x:Key="PrinterGridMutedForegroundBrush" Color="#D6D9DE"/>
<SolidColorBrush x:Key="PrinterGridLineBrush" Color="#3A3E46"/>

<Style TargetType="Button">
<Setter Property="Padding" Value="14,8"/>
<Setter Property="Margin" Value="0,0,8,8"/>
<Setter Property="MinHeight" Value="36"/>
<Setter Property="MinWidth" Value="84"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>

<Style x:Key="PrimaryButtonStyle" TargetType="Button">
<Setter Property="Padding" Value="16,9"/>
<Setter Property="Margin" Value="0,0,8,8"/>
<Setter Property="MinHeight" Value="38"/>
<Setter Property="MinWidth" Value="100"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>

<Style TargetType="TextBox">
<Setter Property="Padding" Value="12,8"/>
<Setter Property="MinHeight" Value="40"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>

<Style x:Key="SearchTextBoxStyle" TargetType="TextBox">
<Setter Property="Padding" Value="12,7"/>
<Setter Property="MinHeight" Value="38"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="#292C32"/>
<Setter Property="Foreground" Value="#F2F3F5"/>
<Setter Property="BorderBrush" Value="#444850"/>
<Setter Property="BorderThickness" Value="1"/>
</Style>

<Style x:Key="PrinterGridTextStyle" TargetType="TextBlock">
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="TextTrimming" Value="CharacterEllipsis"/>
</Style>

<Style TargetType="DataGrid">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="{StaticResource PrinterGridBackgroundBrush}"/>
<Setter Property="Foreground" Value="{StaticResource PrinterGridForegroundBrush}"/>
<Setter Property="RowBackground" Value="{StaticResource PrinterGridRowBrush}"/>
<Setter Property="AlternatingRowBackground" Value="{StaticResource PrinterGridAlternateRowBrush}"/>
<Setter Property="AlternationCount" Value="2"/>
<Setter Property="HorizontalGridLinesBrush" Value="{StaticResource PrinterGridLineBrush}"/>
<Setter Property="VerticalGridLinesBrush" Value="{StaticResource PrinterGridLineBrush}"/>
<Setter Property="RowHeight" Value="33"/>
<Setter Property="ColumnHeaderHeight" Value="34"/>
<Setter Property="GridLinesVisibility" Value="Horizontal"/>
<Setter Property="HeadersVisibility" Value="Column"/>
</Style>

<Style TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="{StaticResource PrinterGridHeaderBrush}"/>
<Setter Property="Foreground" Value="{StaticResource PrinterGridForegroundBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource PrinterGridLineBrush}"/>
<Setter Property="BorderThickness" Value="0,0,1,1"/>
<Setter Property="Padding" Value="7,4"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>

<Style TargetType="DataGridRow">
<Setter Property="Foreground" Value="{StaticResource PrinterGridForegroundBrush}"/>
<Setter Property="Background" Value="{StaticResource PrinterGridRowBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource PrinterGridLineBrush}"/>
<Setter Property="BorderThickness" Value="0,0,0,1"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Style.Triggers>
<Trigger Property="AlternationIndex" Value="1">
<Setter Property="Background" Value="{StaticResource PrinterGridAlternateRowBrush}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource PrinterGridHoverBrush}"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{StaticResource PrinterGridSelectedBrush}"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>

<Style TargetType="DataGridCell">
<Setter Property="Foreground" Value="{Binding Foreground, RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="4,0"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>

<Style x:Key="SectionHeaderStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="15"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Margin" Value="0,18,0,10"/>
</Style>

<Style x:Key="MutedTextStyle" TargetType="TextBlock">
<Setter Property="Opacity" Value="0.68"/>
</Style>
</Application.Resources>
</Application>
64 changes: 64 additions & 0 deletions PrinterManagerNativeTool/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using System.Windows;
using PrinterManagerNativeTool.Services;

namespace PrinterManagerNativeTool;

public partial class App : Application
{
protected override async void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);

if (e.Args.Length >= 2 &&
string.Equals(e.Args[0], "--admin", StringComparison.OrdinalIgnoreCase))
{
await RunAdministrativeActionAsync(e.Args[1]);
Shutdown();
return;
}

var window = new MainWindow();
MainWindow = window;
window.Show();
}

private static async Task RunAdministrativeActionAsync(string action)
{
var spooler = new SpoolerService();

try
{
switch (action.ToLowerInvariant())
{
case "restart-spooler":
await spooler.RestartAsync();
MessageBox.Show(
"Spooler di stampa riavviato correttamente.",
"Printer Manager",
MessageBoxButton.OK,
MessageBoxImage.Information);
break;

case "clear-spooler":
await spooler.ClearAsync();
MessageBox.Show(
"Coda spooler pulita correttamente.",
"Printer Manager",
MessageBoxButton.OK,
MessageBoxImage.Information);
break;

default:
throw new ArgumentException($"Azione amministrativa sconosciuta: {action}");
}
}
catch (Exception ex)
{
MessageBox.Show(
ex.Message,
"Printer Manager - Errore",
MessageBoxButton.OK,
MessageBoxImage.Error);
}
}
}
Loading
Loading