Skip to content

Added C# example for NVDA controller client DLL#9600

Merged
feerrenrut merged 5 commits into
nvaccess:masterfrom
DataTriny:cs_example
May 21, 2019
Merged

Added C# example for NVDA controller client DLL#9600
feerrenrut merged 5 commits into
nvaccess:masterfrom
DataTriny:cs_example

Conversation

@DataTriny

Copy link
Copy Markdown
Contributor

Link to issue number:

Based on #7010.

Summary of the issue:

The original author of #7010 seems not to be active anymore, even if there are still review actions to perform on the PR.

Description of how this pull request fixes the issue:

This PR introduces a C# program containing a PInvoke wrapper around nvdaControllerClient.dll, and demonstrates how to use it.
I also updated the readme. I think that the link pointing to the pre-built binaries should be updated as well.

Testing performed:

Performed the same tasks as in the Python example.

Known issues with pull request:

None.

Change log entry:

Section: New features

  • Added a new example to demonstrate how to call the nvdaControllerClient.dll from C#.

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks for taking this on.
It looks like the file is included twice. Please delete the example.cs one, the other comments for that file also apply to the example_csharp.cs file

Comment thread extras/controllerClient/x86/example.cs Outdated
/// <param name="interrupt">If true, NVDA will immediately speak the text, interrupting whatever it was speaking before.</param>
public static void Speak(string text, bool interrupt = true)
{
if (interrupt)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

While it is certainly valid to leave the braces out, it's not recommended. It is very easy for someone to add a second line to this which will not be subject to the condition.

Comment thread extras/controllerClient/x86/example.cs Outdated
@DataTriny

Copy link
Copy Markdown
Contributor Author

Sorry, but it is so common in the .NET world to adopt this coding style.
Everything fixed!

@feerrenrut

Copy link
Copy Markdown
Contributor

No problem, I understand the temptation. I have just seen too much wasted time because of it. Thanks for making the changes.

@feerrenrut feerrenrut merged commit e5a362d into nvaccess:master May 21, 2019
@nvaccessAuto nvaccessAuto added this to the 2019.2 milestone May 21, 2019
feerrenrut added a commit that referenced this pull request May 21, 2019
@DataTriny DataTriny deleted the cs_example branch May 21, 2019 15:41
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.

3 participants