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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Photino.NET/PhotinoDllImports.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,18 @@ public partial class PhotinoWindow
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
static partial void Photino_SetZoom(IntPtr instance, int zoom);

[LibraryImport(DLL_NAME, SetLastError = true)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
static partial void Photino_SetFlash(IntPtr instance, [MarshalAs(UnmanagedType.I1)] bool state);

[LibraryImport(DLL_NAME, SetLastError = true)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
static partial void Photino_SetProgress(IntPtr instance, ulong current, ulong total, PhotinoWindowProgressState state);

[LibraryImport(DLL_NAME, SetLastError = true)]
[UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
static partial void Photino_ClearProgress(IntPtr instance);


//MISC
[LibraryImport(DLL_NAME, SetLastError = true)]
Expand Down
21 changes: 21 additions & 0 deletions Photino.NET/PhotinoWindow.NET.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2289,6 +2289,27 @@ public PhotinoWindow SetZoom(int zoom)
return this;
}

public PhotinoWindow SetFlash(bool state)
{
Log($".SetFlash({state})");
Invoke(() => Photino_SetFlash(_nativeInstance, state));
Comment on lines +2292 to +2295

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameter name state in SetFlash(bool state) is ambiguous (state of what?). Consider renaming to enabled/flash (or similar) to align with other boolean setters like SetTopMost(bool topMost) and improve call-site readability.

Suggested change
public PhotinoWindow SetFlash(bool state)
{
Log($".SetFlash({state})");
Invoke(() => Photino_SetFlash(_nativeInstance, state));
public PhotinoWindow SetFlash(bool flash)
{
Log($".SetFlash({flash})");
Invoke(() => Photino_SetFlash(_nativeInstance, flash));

Copilot uses AI. Check for mistakes.
return this;
Comment on lines +2292 to +2296

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These newly added public APIs (SetFlash, SetProgress, ClearProgress) don’t have XML doc comments, while the surrounding public Set* methods do. Please add <summary>, <param>, and <returns> docs (and any platform/behavior notes) to keep the public surface consistent and ensure consumers get IntelliSense help.

Copilot uses AI. Check for mistakes.
}

public PhotinoWindow SetProgress(ulong current, ulong total, PhotinoWindowProgressState state)
{
Log($".SetProgress({current}, {total}, {state})");
Invoke(() => Photino_SetProgress(_nativeInstance, current, total, state));
return this;
}

public PhotinoWindow ClearProgress()
{
Log($".ClearProgress()");
Invoke(() => Photino_ClearProgress(_nativeInstance));
return this;
}

/// <summary>
/// When true the native window starts up at the OS Default location.
/// Default is true.
Expand Down
11 changes: 11 additions & 0 deletions Photino.NET/PhotinoWindowEnums.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using System;

Comment on lines +1 to +2

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using System; is unused in this file and will trigger CS8019 (unnecessary using directive) in builds that treat warnings strictly. Consider removing the directive (or adding an actual use, e.g., XML docs don’t require it).

Suggested change
using System;

Copilot uses AI. Check for mistakes.
namespace Photino.NET;

public enum PhotinoWindowProgressState
{
Error,
Paused,
Normal,
Comment on lines +4 to +9

Copilot AI Apr 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This new public enum is missing the XML documentation used elsewhere for public enums (see PhotinoDialogEnums.cs). Adding a <summary> for the enum and brief docs for each member will keep the public API documentation consistent.

Suggested change
public enum PhotinoWindowProgressState
{
Error,
Paused,
Normal,
/// <summary>
/// Represents the state of the progress indicator for a <c>PhotinoWindow</c>.
/// </summary>
public enum PhotinoWindowProgressState
{
/// <summary>
/// Indicates that the operation has failed or encountered an error.
/// </summary>
Error,
/// <summary>
/// Indicates that the operation has been paused.
/// </summary>
Paused,
/// <summary>
/// Indicates that the operation is in progress with a determinate value.
/// </summary>
Normal,
/// <summary>
/// Indicates that the operation is in progress with an indeterminate value.
/// </summary>

Copilot uses AI. Check for mistakes.
Indeterminate,
}
Loading