Skip to content

Streamline single/multipage API - #14

Merged
kpreisser merged 1 commit into
kpreisser:taskdialogfrom
RussKie:taskdialog
Mar 23, 2020
Merged

kpreisser merged 1 commit into
kpreisser:taskdialogfrom
RussKie:taskdialog

Conversation

@RussKie

@RussKie RussKie commented Mar 17, 2020

Copy link
Copy Markdown

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);

@kpreisser kpreisser left a comment

Copy link
Copy Markdown
Owner

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)

@kpreisser kpreisser Mar 23, 2020 •

Copy link
Copy Markdown
Owner

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
Copy Markdown
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

RussKie commented Mar 23, 2020

Copy link
Copy Markdown
Author

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