Resolving warnings and treating warnings as errors in WinUI project. (#824)

This commit is contained in:
Burak Kaan Köse
2026-02-27 20:12:43 +01:00
committed by GitHub
parent d2fce5eee1
commit 0e742c7a8f
55 changed files with 336 additions and 269 deletions
+15 -6
View File
@@ -24,10 +24,10 @@ namespace Wino.Mail.WinUI.Services;
public class PrintService : IPrintService
{
private TaskCompletionSource<PrintingResult> _taskCompletionSource;
private CanvasPrintDocument printDocument;
private PrintTask printTask;
private PdfDocument pdfDocument;
private TaskCompletionSource<PrintingResult>? _taskCompletionSource;
private CanvasPrintDocument? printDocument;
private PrintTask? printTask;
private PdfDocument? pdfDocument;
private List<CanvasBitmap> bitmaps = new();
private Vector2 largestBitmap;
@@ -41,7 +41,7 @@ public class PrintService : IPrintService
private int bitmapsPerPage;
private int pageCount = -1;
private PrintInformation _currentPrintInformation;
private PrintInformation? _currentPrintInformation;
public async Task<PrintingResult> PrintPdfFileAsync(string pdfFilePath, string printTitle)
{
@@ -125,6 +125,9 @@ public class PrintService : IPrintService
printTask = args.Request.CreatePrintTask(_currentPrintInformation.PDFTitle, (createPrintTaskArgs) =>
{
if (printDocument == null)
return;
createPrintTaskArgs.SetSource(printDocument);
});
@@ -191,6 +194,9 @@ public class PrintService : IPrintService
private async Task LoadPDFPageBitmapsAsync(CanvasPrintDocument sender)
{
if (pdfDocument == null)
return;
ClearBitmaps();
bitmaps ??= new List<CanvasBitmap>();
@@ -226,6 +232,9 @@ public class PrintService : IPrintService
{
var detailedOptions = PrintTaskOptionDetails.GetFromPrintTaskOptions(args.PrintTaskOptions);
if (pdfDocument == null)
return;
int pageCountToPrint = (int)pdfDocument.PageCount;
for (uint i = 1; i <= pageCountToPrint; ++i)
@@ -239,7 +248,7 @@ public class PrintService : IPrintService
private void DrawPdfPage(CanvasPrintDocument sender, CanvasDrawingSession ds, uint pageNumber)
{
if (bitmaps?.Count == 0) return;
if (bitmaps.Count == 0) return;
var cellAcross = new Vector2(cellSize.X, 0);
var cellDown = new Vector2(0, cellSize.Y);