Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streamline single/multipage API #14

Merged
merged 1 commit into from
Mar 23, 2020

Conversation

RussKie
Copy link

@RussKie RussKie commented Mar 17, 2020

Closes #13

Proposed changes

  • reduce the public API surface to only static entry points:
    public static TaskDialogButton ShowDialog(TaskDialogPage page);
    public static TaskDialogButton ShowDialog(IntPtr hwndOwner, TaskDialogPage page);
    public static TaskDialogButton ShowDialog(IWin32Window owner, TaskDialogPage page);
  • remove now defunct events and their plumbing
  • to facilitate the navigation to another page add TaskDialogPage.Navigate(TaskDialogPage page), that will allow to write something like:
    button1.Click += (s, e) => button1.BoundPage.Navigate(page2);

Copy link
Owner

@kpreisser kpreisser left a comment

Choose a reason for hiding this comment

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

Thanks!

@kpreisser kpreisser merged commit 02de400 into kpreisser:taskdialog Mar 23, 2020
/// </exception>
public static unsafe TaskDialogButton ShowDialog(IntPtr hwndOwner, TaskDialogPage page)
{
if (hwndOwner == null)
Copy link
Owner

@kpreisser kpreisser Mar 23, 2020

Choose a reason for hiding this comment

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

This will always be false as it will result in comparing a non-null IntPtr? (e.g. IntPtr.Zero) with a null IntPtr?.

Copy link
Author

Choose a reason for hiding this comment

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

Aye, it was a mindless copy-paste...

@RussKie RussKie deleted the taskdialog branch March 23, 2020 21:23
@RussKie
Copy link
Author

RussKie commented Mar 23, 2020

If you think I've missed anything, by all means feel free to correct it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants