Skip to content

Commit 8eff768

Browse files
Automated dotnet-format update
1 parent cc62c6f commit 8eff768

10 files changed

Lines changed: 52 additions & 2 deletions

File tree

src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.macos.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ namespace CommunityToolkit.Maui.Media;
99
public sealed partial class SpeechToTextImplementation
1010
{
1111
[MemberNotNull(nameof(audioEngine), nameof(recognitionTask), nameof(liveSpeechRequest), nameof(getRecognitionTaskCompletionSource))]
12+
[Obsolete]
1213
Task InternalStartListeningAsync(CultureInfo culture, CancellationToken cancellationToken)
1314
{
1415
speechRecognizer = new SFSpeechRecognizer(NSLocale.FromLocaleIdentifier(culture.Name));

src/CommunityToolkit.Maui.Core/Essentials/SpeechToText/SpeechToTextImplementation.windows.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuous
7777
OnRecognitionResultUpdated(args.Result.Text);
7878
}
7979

80-
Task InternalStopListeningAsync(CancellationToken cancellationToken) => StopRecording(cancellationToken);
80+
Task InternalStopListeningAsync(CancellationToken cancellationToken) => StopRecording(cancellationToken);
8181

8282
async Task<string> InternalListenAsync(CultureInfo culture, IProgress<string>? recognitionResult, CancellationToken cancellationToken)
8383
{

src/CommunityToolkit.Maui.Maps/Handler/Map/MapHandler.Windows.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ public MapHandlerWindows() : base(Mapper, CommandMapper)
4040

4141
/// <inheritdoc/>
4242

43+
[Obsolete]
4344
protected override FrameworkElement CreatePlatformView()
4445
{
4546
if (string.IsNullOrEmpty(MapsKey))

src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.android.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ namespace CommunityToolkit.Maui.Core.Views;
1212
/// </summary>
1313
public class MauiMediaElement : CoordinatorLayout
1414
{
15+
[Obsolete]
1516
readonly StyledPlayerView playerView;
1617

1718
/// <summary>
1819
/// Initializes a new instance of the <see cref="MauiMediaElement"/> class.
1920
/// </summary>
2021
/// <param name="context">The application's <see cref="Context"/>.</param>
2122
/// <param name="playerView">The <see cref="StyledPlayerView"/> that acts as the platform media player.</param>
23+
[Obsolete]
2224
public MauiMediaElement(Context context, StyledPlayerView playerView) : base(context)
2325
{
2426
this.playerView = playerView;

src/CommunityToolkit.Maui.MediaElement/Views/MauiMediaElement.windows.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void Dispose()
4242
/// </summary>
4343
protected virtual void Dispose(bool disposing)
4444
{
45-
if(isDisposed)
45+
if (isDisposed)
4646
{
4747
return;
4848
}

src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.android.cs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace CommunityToolkit.Maui.Core.Views;
1515

16+
[Obsolete]
1617
public partial class MediaManager : Java.Lang.Object, IPlayer.IListener
1718
{
1819
readonly SemaphoreSlim seekToSemaphoreSlim = new(1, 1);
@@ -25,13 +26,15 @@ public partial class MediaManager : Java.Lang.Object, IPlayer.IListener
2526
/// <summary>
2627
/// The platform native counterpart of <see cref="MediaElement"/>.
2728
/// </summary>
29+
[Obsolete]
2830
protected StyledPlayerView? PlayerView { get; set; }
2931

3032
/// <summary>
3133
/// Creates the corresponding platform view of <see cref="MediaElement"/> on Android.
3234
/// </summary>
3335
/// <returns>The platform native counterpart of <see cref="MediaElement"/>.</returns>
3436
/// <exception cref="NullReferenceException">Thrown when <see cref="Android.Content.Context"/> is <see langword="null"/> or when the platform view could not be created.</exception>
37+
[Obsolete]
3538
public (PlatformMediaElement platformView, StyledPlayerView PlayerView) CreatePlatformView()
3639
{
3740
ArgumentNullException.ThrowIfNull(MauiContext.Context);
@@ -56,6 +59,7 @@ public partial class MediaManager : Java.Lang.Object, IPlayer.IListener
5659
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
5760
/// While this method does not seem to have any references, it's invoked at runtime.
5861
/// </remarks>
62+
[Obsolete]
5963
public void OnPlaybackParametersChanged(PlaybackParameters? playbackParameters)
6064
{
6165
if (playbackParameters is null)
@@ -78,6 +82,7 @@ public void OnPlaybackParametersChanged(PlaybackParameters? playbackParameters)
7882
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
7983
/// While this method does not seem to have any references, it's invoked at runtime.
8084
/// </remarks>
85+
[Obsolete]
8186
public void OnPlayerStateChanged(bool playWhenReady, int playbackState)
8287
{
8388
if (Player is null || MediaElement.Source is null)
@@ -127,6 +132,7 @@ or PlaybackStateCompat.StateSkippingToQueueItem
127132
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
128133
/// While this method does not seem to have any references, it's invoked at runtime.
129134
/// </remarks>
135+
[Obsolete]
130136
public void OnPlaybackStateChanged(int playbackState)
131137
{
132138
if (MediaElement.Source is null)
@@ -161,6 +167,7 @@ public void OnPlaybackStateChanged(int playbackState)
161167
/// This is part of the <see cref="IPlayer.IListener"/> implementation.
162168
/// While this method does not seem to have any references, it's invoked at runtime.
163169
/// </remarks>
170+
[Obsolete]
164171
public void OnPlayerError(PlaybackException? error)
165172
{
166173
var errorMessage = string.Empty;
@@ -252,6 +259,7 @@ protected virtual partial void PlatformPause()
252259
Player.Pause();
253260
}
254261

262+
[Obsolete]
255263
protected virtual async partial Task PlatformSeek(TimeSpan position, CancellationToken token)
256264
{
257265
if (Player is null)
@@ -291,6 +299,7 @@ protected virtual partial void PlatformStop()
291299
MediaElement.Position = TimeSpan.Zero;
292300
}
293301

302+
[Obsolete]
294303
protected virtual partial void PlatformUpdateSource()
295304
{
296305
var hasSetSource = false;
@@ -356,6 +365,7 @@ protected virtual partial void PlatformUpdateSource()
356365
}
357366
}
358367

368+
[Obsolete]
359369
protected virtual partial void PlatformUpdateAspect()
360370
{
361371
if (PlayerView is null)
@@ -472,6 +482,7 @@ protected virtual partial void PlatformUpdateShouldMute()
472482
Player.Volume = MediaElement.ShouldMute ? 0 : volumeBeforeMute;
473483
}
474484

485+
[Obsolete]
475486
protected virtual partial void PlatformUpdateShouldLoopPlayback()
476487
{
477488
if (Player is null)
@@ -484,26 +495,49 @@ protected virtual partial void PlatformUpdateShouldLoopPlayback()
484495

485496
#region IPlayer.IListener implementation method stubs
486497

498+
[Obsolete]
487499
public void OnAudioAttributesChanged(AudioAttributes? audioAttributes) { }
488500
public void OnAudioSessionIdChanged(int audioSessionId) { }
501+
502+
[Obsolete]
489503
public void OnAvailableCommandsChanged(IPlayer.Commands? availableCommands) { }
504+
505+
[Obsolete]
490506
public void OnCues(CueGroup? cueGroup) { }
507+
508+
[Obsolete]
491509
public void OnCues(List<Cue> cues) { }
510+
511+
[Obsolete]
492512
public void OnDeviceInfoChanged(Com.Google.Android.Exoplayer2.DeviceInfo? deviceInfo) { }
493513
public void OnDeviceVolumeChanged(int volume, bool muted) { }
514+
515+
[Obsolete]
494516
public void OnEvents(IPlayer? player, IPlayer.Events? events) { }
495517
public void OnIsLoadingChanged(bool isLoading) { }
496518
public void OnIsPlayingChanged(bool isPlaying) { }
497519
public void OnLoadingChanged(bool isLoading) { }
498520
public void OnMaxSeekToPreviousPositionChanged(long maxSeekToPreviousPositionMs) { }
521+
522+
[Obsolete]
499523
public void OnMediaItemTransition(MediaItem? mediaItem, int transition) { }
524+
525+
[Obsolete]
500526
public void OnMediaMetadataChanged(MediaMetadata? mediaMetadata) { }
527+
528+
[Obsolete]
501529
public void OnMetadata(Metadata? metadata) { }
502530
public void OnPlaybackSuppressionReasonChanged(int playbackSuppressionReason) { }
531+
532+
[Obsolete]
503533
public void OnPlayerErrorChanged(PlaybackException? error) { }
534+
535+
[Obsolete]
504536
public void OnPlaylistMetadataChanged(MediaMetadata? mediaMetadata) { }
505537
public void OnPlayWhenReadyChanged(bool playWhenReady, int reason) { }
506538
public void OnPositionDiscontinuity(int reason) { }
539+
540+
[Obsolete]
507541
public void OnPositionDiscontinuity(IPlayer.PositionInfo oldPosition, IPlayer.PositionInfo newPosition, int reason) { }
508542
public void OnRenderedFirstFrame() { }
509543
public void OnRepeatModeChanged(int repeatMode) { }
@@ -512,9 +546,17 @@ public void OnSeekForwardIncrementChanged(long seekForwardIncrementMs) { }
512546
public void OnShuffleModeEnabledChanged(bool shuffleModeEnabled) { }
513547
public void OnSkipSilenceEnabledChanged(bool skipSilenceEnabled) { }
514548
public void OnSurfaceSizeChanged(int width, int height) { }
549+
550+
[Obsolete]
515551
public void OnTimelineChanged(Timeline? timeline, int reason) { }
552+
553+
[Obsolete]
516554
public void OnTracksChanged(Tracks? tracks) { }
555+
556+
[Obsolete]
517557
public void OnTrackSelectionParametersChanged(TrackSelectionParameters? trackSelectionParameters) { }
558+
559+
[Obsolete]
518560
public void OnVideoSizeChanged(VideoSize? videoSize) { }
519561

520562
#endregion

src/CommunityToolkit.Maui.MediaElement/Views/MediaManager.shared.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ public MediaManager(IMauiContext context, IMediaElement mediaElement, IDispatche
6363
/// <summary>
6464
/// The platform-specific media player.
6565
/// </summary>
66+
[Obsolete]
6667
protected PlatformMediaElement? Player { get; set; }
6768
#endif
6869

src/CommunityToolkit.Maui.UnitTests/Behaviors/MaxLengthReachedBehaviorTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ public void ShouldNotDismissKeyboardWhenOptionSetToFalse()
140140
Assert.True(entry.IsFocused);
141141
}
142142

143+
[Obsolete]
143144
static Entry CreateEntry(int? maxLength = 2,
144145
bool shouldDismissKeyboardAutomatically = false,
145146
ICommand? command = null,

src/CommunityToolkit.Maui.UnitTests/Behaviors/SetFocusOnEntryCompletedTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public void SetsFocusWhenCompleted()
3535
Assert.True(entry2.IsFocused);
3636
}
3737

38+
[Obsolete]
3839
static Entry CreateEntry(VisualElement? nextElement = null)
3940
{
4041
var entry = new Entry();

src/CommunityToolkit.Maui.UnitTests/Behaviors/UserStoppedTypingBehaviorTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ public async Task ShouldExecuteCommandImmediatelyWhenMinimumLengthThresholdHasNo
239239
Assert.True(commandHasBeenExecuted);
240240
}
241241

242+
[Obsolete]
242243
static Entry CreateEntryWithBehavior(int stoppedTypingTimeThreshold = 500,
243244
int minimumLengthThreshold = 0,
244245
bool shouldDismissKeyboardAutomatically = false,

0 commit comments

Comments
 (0)