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

Improve code readability through added inline comments in Win10OcrProvider #494

Open
wants to merge 5 commits into
base: release/1.3
Choose a base branch
from

Conversation

benjisho
Copy link

@benjisho benjisho commented May 31, 2023

In this pull request, we've added several inline comments to the Win10OcrProvider class in the Greenshot.Plugin.Win10 namespace. The comments provide a more in-depth understanding of the OCR process flow, functions, and important parameters in this class.

Here's a brief overview of the key improvements:

  1. Clarification of the role and flow of different methods within the class, such as DoOcrAsync variants and CreateOcrInformation.

  2. Explanation of particular operations, such as image sizing adjustments prior to the OCR process and the actual OCR process.

  3. Description of logged information, such as available OCR languages.

  4. Improved error handling in Win10Plugin's Initialize method in src/Greenshot.Plugin.Win10/Win10Plugin.cs. (Added a try-catch block to the Initialize method to catch and log any exceptions that occur during initialization.)

These enhancements aim to improve the maintainability and readability of the code, making it easier for other contributors to understand and work on the project. No functional changes were made in this pull request except the try-catch block.

Please review and provide any feedback.

Thank you!

This pull request adds more robust error handling to the Initialize method in the Win10Plugin class. The changes include:

1. Added a try-catch block to the Initialize method to catch and log any exceptions that occur during initialization.

2. Enhanced the logging of exceptions to include not only the error message but also the entire error content, including the stack trace. This change makes debugging easier by providing more context when an error occurs.
This commit updates the comment style in the Win10Configuration.cs file to use XML comments, enhancing readability and providing better IntelliSense support in IDEs.

The changes include:

Class and property comments have been updated to use XML documentation syntax, providing a more detailed and consistent documentation style.
Here's an example of the changes:
```
        /// <summary>
        /// Gets or sets a value indicating whether OCR should be run automatically on every capture.
        /// </summary>
```
This change is purely cosmetic and does not affect the functionality of the code.
This commit adds more XML documentation comments to the ToastNotificationService.cs file, improving the clarity and readability of the code. This change is purely cosmetic and does not affect the functionality of the code.
Added comments to describe each section of the project file. This helps other developers understand why certain files are included or why certain package references are needed.

```
  <!-- Including language XML files to copy to the output directory for localization. -->

  <!-- Adding NuGet package references required by the project. -->

  <!-- Adding project references/dependencies for the project. -->

```
This commit introduces more inline comments to the Win10OcrProvider class. These comments aim to improve the understanding of the class functions and the flow of the OCR process. Key areas clarified include:

1. Logging of available OCR languages.
2. Handling of image sizing before OCR process.
3. The OCR process itself and the creation of the OCR result.
@CLAassistant
Copy link

CLAassistant commented May 31, 2023

CLA assistant check
All committers have signed the CLA.

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.

None yet

2 participants