-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor URLs and improve logging consistency (#2228)
* Refactor URLs and improve logging consistency - Use string interpolation for URLs in various methods. - Add default values for `CancellationToken` in `LoadViewAsync`. - Update logging placeholders for consistent casing in `MediaElementPage.xaml.cs`. - Switch to `Trace.TraceInformation` in `OnRowTapped`. - Enhance exception logging in `DownloadDotNetBotImage`. - Improve code readability and maintainability. * Fix strack trace issue * Switch to Trace.TraceError for error logging Updated the logging mechanism for handling exceptions across multiple files. Replaced `Trace.WriteLine` with `Trace.TraceError` in the following methods and classes: - `async Task OnAnimate(CancellationToken token)` in `AnimationBehavior.shared.cs` - `protected void OnViewPropertyChanged(object? sender, PropertyChangedEventArgs e)` in `ICommunityToolkitBehavior.shared.cs` - `protected override void OnDetachingFrom(Grid bindable)` in `ImpliedOrderGridBehavior.shared.cs` - `internal async Task ForceUpdateState(CancellationToken token, bool animated = true)` in `TouchBehavior.methods.shared.cs` - `void OnChildrenCollectionChanged(object? sender, NotifyCollectionChangedEventArgs e)` in `MultiValidationBehavior.shared.cs` - `async ValueTask UpdateStateAsync(VisualElement? view, ValidationFlags flags, bool isValid)` in `ValidationBehavior.shared.cs` - `public abstract class BaseConverter<[DynamicallyAccessedMembers(DynamicallyAccessedMemberTypes.All)]>` in `BaseConverter.shared.cs` (multiple methods) * Refactor hardcoded URIs to direct strings Disabled and restored S1075 warning across multiple files. Refactored hardcoded URIs to be directly passed as strings: - ExpanderPageCS.cs: `Launcher.OpenAsync` method - MediaElementPage.xaml.cs: media sources - FileSaverViewModel.cs: `GetStreamAsync` method - MediaElementCarouselViewViewModel.cs and MediaElementCollectionViewViewModel.cs: `ObservableCollection` initialization * Missed one $ * fix Suppresion * Improve exception logging format across multiple methods Updated logging to use formatted messages with exception details instead of directly logging stack traces. This change affects methods in ByteArrayToImageSourceConverterViewModel.cs, AnimationBehavior.shared.cs, ICommunityToolkitBehavior.shared.cs, TouchBehavior.methods.shared.cs, ValidationBehavior.shared.cs, and BaseConverter.shared.cs. Enhances log readability and debugging efficiency. * Define URLs as constant * Define URLs as constants * Use `const` to define URLs * Replace `TraceError` with `TraceInformation` --------- Co-authored-by: Brandon Minnick <[email protected]>
- Loading branch information
1 parent
0b8f8ef
commit 372d873
Showing
16 changed files
with
69 additions
and
46 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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