-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refactor main logic into async RunSample method #79
Draft
alafleur-genetec
wants to merge
10
commits into
main
Choose a base branch
from
bug-fix
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Encapsulated main logic within an async RunSample method. Moved connection details and Engine initialization inside RunSample. Relocated LogOnAsync call and subsequent logic to RunSample. Added connection state check and entity processing in RunSample. Called LoadAreas and LoadFiles within RunSample to cache entities. Handled retrieval and processing of Area and File entities in RunSample. Moved console output for login failure and exit prompt to RunSample. Added await RunSample() to main program flow.
Refactored several methods in `Program.cs` to include an `Engine` parameter, ensuring explicit dependency injection. Updated `RunSample` to initialize and pass the `Engine` instance to `LoadCamerasIntoCache`, `GetCameraConfigurations`, `LoadAreas`, and `LoadFiles`. Modified `DisplayToConsole` methods for `CameraConfiguration` and `Area` to use the `Engine` parameter. These changes enhance code modularity, readability, and maintainability.
Encapsulated main logic into an async RunSample method called at the start of Main. Moved connection details, Engine initialization, and LogOnAsync handling inside RunSample. Nested PTZ camera operations within RunSample, ensuring execution only on successful logon. Scoped FindPtzCamera and LoadNetworks methods within RunSample. Added checks for camera presets and appropriate messages for various failure states. Included IsPtzCamera predicate within FindPtzCamera. Final exit message moved inside RunSample.
Updated Microsoft.Windows.Compatibility package to version 8.0.8 for latest features and bug fixes. Added LoggerSample.exe.gconfig to always copy to output directory during build for runtime configuration.
alafleur-genetec
changed the title
Refactor main logic into async RunSample method
Multiple bug fixes
Sep 28, 2024
Updated project references and package dependencies across multiple .csproj files to support .NET 8.0 for Windows. Key changes include: - Updated `Microsoft.Windows.Compatibility` package from `8.0.6` to `8.0.8`. - Added `FrameworkReference` to `Microsoft.WindowsDesktop.App.WPF` for WPF applications. - Added and removed references to essential .NET assemblies (`System`, `System.Core`, `PresentationCore`, `PresentationFramework`, `WindowsBase`, `System.Drawing`, `System.Data.DataSetExtensions`). - Added `Microsoft.Bcl.AsyncInterfaces` package reference to some projects. - Removed `DebugType` property for `net481` configurations in `VisitorManagerSample.csproj`. - Added a `Target` named `CopyCertificates` to copy certificates post-build. These changes ensure compatibility with .NET 8.0, streamline project files, and improve maintainability.
Introduced the `MediaPlayerApp` class in `MediaPlayerApp.cs` to encapsulate media player functionality, including initialization, event handling, and user interactions. Refactored `Program.cs` to utilize this new class, simplifying the main method and delegating media player and window management responsibilities. Retained `DisplayControls` and `ReadFilePath` methods in `Program.cs` for user input and control instructions. Improved code organization and readability with the new class structure.
- Moved namespace declaration to the top of the file. - Moved `using System;` directive below the namespace.
alafleur-genetec
changed the title
Multiple bug fixes
Refactor main logic into async RunSample method
Oct 3, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.