Skip to content

Starting point for others: Convert MsgBox to MessageBox.Show #1193

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GrahamTheCoder
Copy link
Member

This is generated with a coding agent, but I've skimmed the code to ensure it's roughly the right shape in the right place. If someone's keen to bring this functionality to the system it should be a great starting point (just checkout the branch, try it out, add any more tests/improvements needed).

Note: I'm not intending to work on this further myself at this time, it's just an example to help new contributors.

Agent comments

This change introduces a conversion from Microsoft.VisualBasic.Interaction.MsgBox to System.Windows.Forms.MessageBox.Show.

I handled the mapping of MsgBoxStyle to MessageBoxButtons and MessageBoxIcon, and reordered the arguments appropriately.

The type mapping from MsgBoxResult to DialogResult is not yet implemented.

Problem

Fixes #1166

Solution

  • Any comments on the approach taken, its consistency with surrounding code, etc.
  • Which part of this PR is most in need of attention/improvement? Hasn't been tested in any way. E.g. It may not work at all, or may have all the values it converts flipped backwards.
  • At least one test covering the code changed

This change introduces a conversion from `Microsoft.VisualBasic.Interaction.MsgBox` to `System.Windows.Forms.MessageBox.Show`.

I handled the mapping of `MsgBoxStyle` to `MessageBoxButtons` and `MessageBoxIcon`, and reordered the arguments appropriately.

The type mapping from `MsgBoxResult` to `DialogResult` is not yet implemented.

Fixes icsharpcode#1166
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.

VB -> C#: Convert MsgBox to MessageBox.Show
1 participant