diff --git a/GitTrends.Functions/Functions/GenerateGitHubOAuthToken.cs b/GitTrends.Functions/Functions/GenerateGitHubOAuthToken.cs index 32569e34b..a6bc5086e 100644 --- a/GitTrends.Functions/Functions/GenerateGitHubOAuthToken.cs +++ b/GitTrends.Functions/Functions/GenerateGitHubOAuthToken.cs @@ -12,10 +12,10 @@ namespace GitTrends.Functions { class GenerateGitHubOAuthToken { - readonly static string _clientSecret = Environment.GetEnvironmentVariable("GitTrendsClientSecret") ?? string.Empty; - readonly static string _clientId = Environment.GetEnvironmentVariable("GitTrendsClientId") ?? string.Empty; + static readonly string _clientSecret = Environment.GetEnvironmentVariable("GitTrendsClientSecret") ?? string.Empty; + static readonly string _clientId = Environment.GetEnvironmentVariable("GitTrendsClientId") ?? string.Empty; - readonly static JsonSerializer _serializer = new(); + static readonly JsonSerializer _serializer = new(); readonly GitHubAuthService _gitHubAuthService; diff --git a/GitTrends.Functions/Functions/GetAppCenterApiKeys.cs b/GitTrends.Functions/Functions/GetAppCenterApiKeys.cs index 4711ebcf2..707937619 100644 --- a/GitTrends.Functions/Functions/GetAppCenterApiKeys.cs +++ b/GitTrends.Functions/Functions/GetAppCenterApiKeys.cs @@ -12,8 +12,8 @@ namespace GitTrends.Functions { public static class GetAppCenterApiKeys { - readonly static string _iOS = Environment.GetEnvironmentVariable("AppCenterApiKey_iOS") ?? string.Empty; - readonly static string _android = Environment.GetEnvironmentVariable("AppCenterApiKey_Android") ?? string.Empty; + static readonly string _iOS = Environment.GetEnvironmentVariable("AppCenterApiKey_iOS") ?? string.Empty; + static readonly string _android = Environment.GetEnvironmentVariable("AppCenterApiKey_Android") ?? string.Empty; [Function(nameof(GetAppCenterApiKeys))] public static async Task Run([HttpTrigger(AuthorizationLevel.Function, "get")] HttpRequestData req, FunctionContext context) diff --git a/GitTrends.Functions/Functions/GetGitTrendsEnableOrganizationsUri.cs b/GitTrends.Functions/Functions/GetGitTrendsEnableOrganizationsUri.cs index 5444c4de4..0e17adc31 100644 --- a/GitTrends.Functions/Functions/GetGitTrendsEnableOrganizationsUri.cs +++ b/GitTrends.Functions/Functions/GetGitTrendsEnableOrganizationsUri.cs @@ -10,7 +10,7 @@ namespace GitTrends.Functions { public static class GetGitTrendsEnableOrganizationsUri { - readonly static string _enableOrganizationsUrl = Environment.GetEnvironmentVariable("EnableOrganizationsUrl") ?? string.Empty; + static readonly string _enableOrganizationsUrl = Environment.GetEnvironmentVariable("EnableOrganizationsUrl") ?? string.Empty; [Function(nameof(GetGitTrendsEnableOrganizationsUri))] public static async Task Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequestData req, FunctionContext functionContext) diff --git a/GitTrends.Functions/Functions/GetNotificationHubInformation.cs b/GitTrends.Functions/Functions/GetNotificationHubInformation.cs index 18a6df7cf..bfe0e9e5a 100644 --- a/GitTrends.Functions/Functions/GetNotificationHubInformation.cs +++ b/GitTrends.Functions/Functions/GetNotificationHubInformation.cs @@ -12,8 +12,8 @@ public static class GetNotificationHubInformation public static string NotificationHubName { get; } = Environment.GetEnvironmentVariable("NotificationHubName") ?? string.Empty; public static string NotificationHubName_Debug { get; } = Environment.GetEnvironmentVariable("NotificationHubName_Debug") ?? string.Empty; - readonly static string _notificationHubConnectionString_Debug = Environment.GetEnvironmentVariable("NotificationHubListenConnectionString_Debug") ?? string.Empty; - readonly static string _notificationHubConnectionString = Environment.GetEnvironmentVariable("NotificationHubListenConnectionString") ?? string.Empty; + static readonly string _notificationHubConnectionString_Debug = Environment.GetEnvironmentVariable("NotificationHubListenConnectionString_Debug") ?? string.Empty; + static readonly string _notificationHubConnectionString = Environment.GetEnvironmentVariable("NotificationHubListenConnectionString") ?? string.Empty; [Function(nameof(GetNotificationHubInformation))] public static async Task Run([HttpTrigger(AuthorizationLevel.Function, "get")] HttpRequestData req, FunctionContext functionContext) diff --git a/GitTrends.Functions/Functions/GetStreamingManifests.cs b/GitTrends.Functions/Functions/GetStreamingManifests.cs index 8fb2fc42f..6f20e76ea 100644 --- a/GitTrends.Functions/Functions/GetStreamingManifests.cs +++ b/GitTrends.Functions/Functions/GetStreamingManifests.cs @@ -11,8 +11,8 @@ namespace GitTrends.Functions { public static class GetStreamingManifests { - readonly static string _chartVideoManifestUrl = Environment.GetEnvironmentVariable("ChartVideoManifestUrl") ?? string.Empty; - readonly static string _enableOrganizationsVideoManifestUrl = Environment.GetEnvironmentVariable("EnableOrganizationsVideoManifestUrl") ?? string.Empty; + static readonly string _chartVideoManifestUrl = Environment.GetEnvironmentVariable("ChartVideoManifestUrl") ?? string.Empty; + static readonly string _enableOrganizationsVideoManifestUrl = Environment.GetEnvironmentVariable("EnableOrganizationsVideoManifestUrl") ?? string.Empty; [Function(nameof(GetStreamingManifests))] public static async Task Run([HttpTrigger(AuthorizationLevel.Anonymous, "get")] HttpRequestData req, FunctionContext functionContext) diff --git a/GitTrends.Functions/Functions/GetTestToken.cs b/GitTrends.Functions/Functions/GetTestToken.cs index 7ceb6c178..8e531620a 100644 --- a/GitTrends.Functions/Functions/GetTestToken.cs +++ b/GitTrends.Functions/Functions/GetTestToken.cs @@ -15,7 +15,7 @@ namespace GitTrends.Functions { class GetTestToken { - readonly static IReadOnlyDictionary _testTokenDictionary = new Dictionary + static readonly IReadOnlyDictionary _testTokenDictionary = new Dictionary { { "UITestToken_brminnick", Environment.GetEnvironmentVariable("UITestToken_brminnick") ?? string.Empty }, { "UITestToken_GitTrendsApp", Environment.GetEnvironmentVariable("UITestToken_GitTrendsApp") ?? string.Empty }, diff --git a/GitTrends.Functions/Functions/SendSilentPushNotification.cs b/GitTrends.Functions/Functions/SendSilentPushNotification.cs index c2152157b..3bc170b0e 100644 --- a/GitTrends.Functions/Functions/SendSilentPushNotification.cs +++ b/GitTrends.Functions/Functions/SendSilentPushNotification.cs @@ -12,11 +12,11 @@ public class SendSilentPushNotification { const string _runTwicePerDay = "0 0 */12 * * *"; - readonly static string _notificationHubFullConnectionString_Debug = Environment.GetEnvironmentVariable("NotificationHubFullConnectionString_Debug") ?? string.Empty; - readonly static string _notificationHubFullConnectionString = Environment.GetEnvironmentVariable("NotificationHubFullConnectionString") ?? string.Empty; + static readonly string _notificationHubFullConnectionString_Debug = Environment.GetEnvironmentVariable("NotificationHubFullConnectionString_Debug") ?? string.Empty; + static readonly string _notificationHubFullConnectionString = Environment.GetEnvironmentVariable("NotificationHubFullConnectionString") ?? string.Empty; - readonly static Lazy _clientHolder = new(NotificationHubClient.CreateClientFromConnectionString(_notificationHubFullConnectionString, GetNotificationHubInformation.NotificationHubName)); - readonly static Lazy _debugClientHolder = new(NotificationHubClient.CreateClientFromConnectionString(_notificationHubFullConnectionString_Debug, GetNotificationHubInformation.NotificationHubName_Debug)); + static readonly Lazy _clientHolder = new(NotificationHubClient.CreateClientFromConnectionString(_notificationHubFullConnectionString, GetNotificationHubInformation.NotificationHubName)); + static readonly Lazy _debugClientHolder = new(NotificationHubClient.CreateClientFromConnectionString(_notificationHubFullConnectionString_Debug, GetNotificationHubInformation.NotificationHubName_Debug)); static NotificationHubClient Client => _clientHolder.Value; static NotificationHubClient DebugClient => _debugClientHolder.Value; diff --git a/GitTrends.Functions/Program.cs b/GitTrends.Functions/Program.cs index 66e536610..cd0ce30d5 100644 --- a/GitTrends.Functions/Program.cs +++ b/GitTrends.Functions/Program.cs @@ -16,8 +16,8 @@ namespace GitTrends.Functions { class Program { - readonly static string _token = Environment.GetEnvironmentVariable("UITestToken_brminnick") ?? string.Empty; - readonly static string _storageConnectionString = Environment.GetEnvironmentVariable("AzureWebJobsStorage") ?? string.Empty; + static readonly string _token = Environment.GetEnvironmentVariable("UITestToken_brminnick") ?? string.Empty; + static readonly string _storageConnectionString = Environment.GetEnvironmentVariable("AzureWebJobsStorage") ?? string.Empty; static Task Main(string[] args) { diff --git a/GitTrends.Functions/Services/NuGetService.cs b/GitTrends.Functions/Services/NuGetService.cs index 03f9d9ef6..edead6b13 100644 --- a/GitTrends.Functions/Services/NuGetService.cs +++ b/GitTrends.Functions/Services/NuGetService.cs @@ -17,7 +17,7 @@ class NuGetService { readonly SourceRepository _sourceRepository = Repository.Factory.GetCoreV3("https://api.nuget.org/v3/index.json"); - readonly static IReadOnlyList _csProjFilePaths = new[] + static readonly IReadOnlyList _csProjFilePaths = new[] { Environment.GetEnvironmentVariable("iOSCSProjPath") ?? string.Empty, Environment.GetEnvironmentVariable("UITestCSProjPath") ?? string.Empty, diff --git a/GitTrends.Mobile.Common/Services/AzureFunctionsApiService.cs b/GitTrends.Mobile.Common/Services/AzureFunctionsApiService.cs index 5aa1456d9..19f2bff08 100644 --- a/GitTrends.Mobile.Common/Services/AzureFunctionsApiService.cs +++ b/GitTrends.Mobile.Common/Services/AzureFunctionsApiService.cs @@ -7,7 +7,7 @@ namespace GitTrends.Mobile.Common { public abstract class AzureFunctionsApiService : BaseApiService { - readonly static Lazy _azureFunctionsApiClientHolder = new(() => RefitExtensions.For(CreateHttpClient(AzureConstants.AzureFunctionsApiUrl))); + static readonly Lazy _azureFunctionsApiClientHolder = new(() => RefitExtensions.For(CreateHttpClient(AzureConstants.AzureFunctionsApiUrl))); static IAzureFunctionsApi AzureFunctionsApiClient => _azureFunctionsApiClientHolder.Value; diff --git a/GitTrends.Mobile.Common/Services/EmptyDataViewService.cs b/GitTrends.Mobile.Common/Services/EmptyDataViewService.cs index 32af41832..127bfd5ad 100644 --- a/GitTrends.Mobile.Common/Services/EmptyDataViewService.cs +++ b/GitTrends.Mobile.Common/Services/EmptyDataViewService.cs @@ -6,14 +6,14 @@ namespace GitTrends.Mobile.Common { public static class EmptyDataViewService { - readonly static IReadOnlyList _zeroStarsEmptyDataViewDescription = new[] + static readonly IReadOnlyList _zeroStarsEmptyDataViewDescription = new[] { EmptyDataViewConstantsInternal.ZeroStarsEmptyDataViewDescription1, EmptyDataViewConstantsInternal.ZeroStarsEmptyDataViewDescription2, EmptyDataViewConstantsInternal.ZeroStarsEmptyDataViewDescription3 }; - readonly static Random _random = new((int)DateTime.Now.Ticks); + static readonly Random _random = new((int)DateTime.Now.Ticks); public static string GetReferringSitesTitleText(in RefreshState refreshState) => refreshState switch { diff --git a/GitTrends.UnitTests/MockServices/MockBrowser.cs b/GitTrends.UnitTests/MockServices/MockBrowser.cs index 2461449fd..7abaa9ff5 100644 --- a/GitTrends.UnitTests/MockServices/MockBrowser.cs +++ b/GitTrends.UnitTests/MockServices/MockBrowser.cs @@ -8,7 +8,7 @@ namespace GitTrends.UnitTests { public class MockBrowser : IBrowser { - readonly static WeakEventManager _openAsyncExecutedEventHandler = new(); + static readonly WeakEventManager _openAsyncExecutedEventHandler = new(); public static event EventHandler OpenAsyncExecuted { diff --git a/GitTrends.UnitTests/MockServices/MockLauncher.cs b/GitTrends.UnitTests/MockServices/MockLauncher.cs index 0ce0b2477..592791e5c 100644 --- a/GitTrends.UnitTests/MockServices/MockLauncher.cs +++ b/GitTrends.UnitTests/MockServices/MockLauncher.cs @@ -8,7 +8,7 @@ namespace GitTrends.UnitTests { class MockLauncher : ILauncher { - readonly static WeakEventManager _openAsyncExecutedEventHandler = new(); + static readonly WeakEventManager _openAsyncExecutedEventHandler = new(); public static event EventHandler OpenAsyncExecuted { diff --git a/GitTrends.UnitTests/MockServices/MockPreferences.cs b/GitTrends.UnitTests/MockServices/MockPreferences.cs index 0fed835ed..51acbe91c 100644 --- a/GitTrends.UnitTests/MockServices/MockPreferences.cs +++ b/GitTrends.UnitTests/MockServices/MockPreferences.cs @@ -6,7 +6,7 @@ namespace GitTrends.UnitTests { public class MockPreferences : IPreferences { - readonly static Lazy _hashtableHolder = new(); + static readonly Lazy _hashtableHolder = new(); static Hashtable Hashtable => _hashtableHolder.Value; diff --git a/GitTrends.UnitTests/MockServices/MockSecureStorage.cs b/GitTrends.UnitTests/MockServices/MockSecureStorage.cs index dfee54b66..283948423 100644 --- a/GitTrends.UnitTests/MockServices/MockSecureStorage.cs +++ b/GitTrends.UnitTests/MockServices/MockSecureStorage.cs @@ -7,7 +7,7 @@ namespace GitTrends.UnitTests { class MockSecureStorage : ISecureStorage { - readonly static Lazy _hashtableHolder = new(); + static readonly Lazy _hashtableHolder = new(); static Hashtable Hashtable => _hashtableHolder.Value; diff --git a/GitTrends.UnitTests/MockServices/MockStoreReview.cs b/GitTrends.UnitTests/MockServices/MockStoreReview.cs index e063c13fb..086d61322 100644 --- a/GitTrends.UnitTests/MockServices/MockStoreReview.cs +++ b/GitTrends.UnitTests/MockServices/MockStoreReview.cs @@ -8,9 +8,9 @@ namespace GitTrends.UnitTests { public class MockStoreReview : IStoreReview { - readonly static WeakEventManager _reviewRequestedEventManager = new(); - readonly static WeakEventManager _storeListingOpenedEventManager = new(); - readonly static WeakEventManager _storeReviewPageOpenedEventManager = new(); + static readonly WeakEventManager _reviewRequestedEventManager = new(); + static readonly WeakEventManager _storeListingOpenedEventManager = new(); + static readonly WeakEventManager _storeReviewPageOpenedEventManager = new(); public static event EventHandler StoreListingOpened { diff --git a/GitTrends/App.cs b/GitTrends/App.cs index 494514af7..a426c9de5 100644 --- a/GitTrends/App.cs +++ b/GitTrends/App.cs @@ -12,7 +12,7 @@ namespace GitTrends { public class App : Xamarin.Forms.Application { - readonly static WeakEventManager _resumedEventManager = new(); + static readonly WeakEventManager _resumedEventManager = new(); readonly IAnalyticsService _analyticsService; readonly NotificationService _notificationService; diff --git a/GitTrends/Services/AppInitializationService.cs b/GitTrends/Services/AppInitializationService.cs index 133b8e8d0..533a6aad8 100644 --- a/GitTrends/Services/AppInitializationService.cs +++ b/GitTrends/Services/AppInitializationService.cs @@ -8,7 +8,7 @@ namespace GitTrends { public class AppInitializationService { - readonly static WeakEventManager _initializationCompletedEventManager = new(); + static readonly WeakEventManager _initializationCompletedEventManager = new(); readonly ThemeService _themeService; readonly LanguageService _languageService; diff --git a/GitTrends/Services/BackgroundFetchService.cs b/GitTrends/Services/BackgroundFetchService.cs index 39f0c7ba2..e66d43817 100644 --- a/GitTrends/Services/BackgroundFetchService.cs +++ b/GitTrends/Services/BackgroundFetchService.cs @@ -13,11 +13,11 @@ namespace GitTrends { public class BackgroundFetchService { - readonly static WeakEventManager _eventManager = new(); - readonly static WeakEventManager _scheduleNotifyTrendingRepositoriesCompletedEventManager = new(); - readonly static WeakEventManager _scheduleRetryOrganizationsRepositoriesCompletedEventManager = new(); - readonly static WeakEventManager _repostoryEventManager = new(); - readonly static WeakEventManager _mobileReferringSiteRetrievedEventManager = new(); + static readonly WeakEventManager _eventManager = new(); + static readonly WeakEventManager _scheduleNotifyTrendingRepositoriesCompletedEventManager = new(); + static readonly WeakEventManager _scheduleRetryOrganizationsRepositoriesCompletedEventManager = new(); + static readonly WeakEventManager _repostoryEventManager = new(); + static readonly WeakEventManager _mobileReferringSiteRetrievedEventManager = new(); readonly IJobManager _jobManager; readonly IAnalyticsService _analyticsService; diff --git a/GitTrends/Services/ContainerService.cs b/GitTrends/Services/ContainerService.cs index 44bdc513b..84241ae5a 100644 --- a/GitTrends/Services/ContainerService.cs +++ b/GitTrends/Services/ContainerService.cs @@ -17,7 +17,7 @@ namespace GitTrends { public static class ContainerService { - readonly static Lazy _containerHolder = new(CreateContainer); + static readonly Lazy _containerHolder = new(CreateContainer); public static IContainer Container => _containerHolder.Value; diff --git a/GitTrends/Services/GitHubApiRepositoriesService.cs b/GitTrends/Services/GitHubApiRepositoriesService.cs index 58dc26f52..9b7550d42 100644 --- a/GitTrends/Services/GitHubApiRepositoriesService.cs +++ b/GitTrends/Services/GitHubApiRepositoriesService.cs @@ -13,8 +13,8 @@ namespace GitTrends { public class GitHubApiRepositoriesService { - readonly static WeakEventManager<(Repository Repository, TimeSpan RetryTimeSpan)> _abuseRateLimitFoundEventManager = new(); - readonly static WeakEventManager _repositoryUriNotFoundEventManager = new(); + static readonly WeakEventManager<(Repository Repository, TimeSpan RetryTimeSpan)> _abuseRateLimitFoundEventManager = new(); + static readonly WeakEventManager _repositoryUriNotFoundEventManager = new(); readonly FavIconService _favIconService; readonly IAnalyticsService _analyticsService; diff --git a/GitTrends/Services/GitHubAuthenticationService.cs b/GitTrends/Services/GitHubAuthenticationService.cs index dd0898069..9621f904e 100644 --- a/GitTrends/Services/GitHubAuthenticationService.cs +++ b/GitTrends/Services/GitHubAuthenticationService.cs @@ -12,10 +12,10 @@ namespace GitTrends { public class GitHubAuthenticationService { - readonly static WeakEventManager _loggedOuteventManager = new(); - readonly static WeakEventManager _demoUserActivatedEventManager = new(); - readonly static WeakEventManager _authorizeSessionStartedEventManager = new(); - readonly static WeakEventManager _authorizeSessionCompletedEventManager = new(); + static readonly WeakEventManager _loggedOuteventManager = new(); + static readonly WeakEventManager _demoUserActivatedEventManager = new(); + static readonly WeakEventManager _authorizeSessionStartedEventManager = new(); + static readonly WeakEventManager _authorizeSessionCompletedEventManager = new(); readonly IPreferences _preferences; readonly IAnalyticsService _analyticsService; diff --git a/GitTrends/Services/GitHubGraphQLApiService.cs b/GitTrends/Services/GitHubGraphQLApiService.cs index 3a6e31d73..a31e58ad0 100644 --- a/GitTrends/Services/GitHubGraphQLApiService.cs +++ b/GitTrends/Services/GitHubGraphQLApiService.cs @@ -17,7 +17,7 @@ namespace GitTrends { public class GitHubGraphQLApiService : BaseMobileApiService { - readonly static WeakEventManager<(string, TimeSpan)> _abuseRateLimitFound_GetOrganizationRepositoriesEventManager = new(); + static readonly WeakEventManager<(string, TimeSpan)> _abuseRateLimitFound_GetOrganizationRepositoriesEventManager = new(); readonly IGitHubGraphQLApi _githubApiClient; readonly GitHubUserService _gitHubUserService; diff --git a/GitTrends/Services/GitHubUserService.cs b/GitTrends/Services/GitHubUserService.cs index c9ef6f4b9..8b973c609 100644 --- a/GitTrends/Services/GitHubUserService.cs +++ b/GitTrends/Services/GitHubUserService.cs @@ -14,10 +14,10 @@ public class GitHubUserService { const string _oauthTokenKey = "OAuthToken"; - readonly static WeakEventManager _nameChangedEventManager = new(); - readonly static WeakEventManager _aliasChangedEventManager = new(); - readonly static WeakEventManager _avatarUrlChangedEventManager = new(); - readonly static WeakEventManager _shouldIncludeOrganizationsChangedEventManager = new(); + static readonly WeakEventManager _nameChangedEventManager = new(); + static readonly WeakEventManager _aliasChangedEventManager = new(); + static readonly WeakEventManager _avatarUrlChangedEventManager = new(); + static readonly WeakEventManager _shouldIncludeOrganizationsChangedEventManager = new(); readonly IPreferences _preferences; readonly ISecureStorage _secureStorage; diff --git a/GitTrends/Services/LanguageService.cs b/GitTrends/Services/LanguageService.cs index e5053e3db..0ba26a7b6 100644 --- a/GitTrends/Services/LanguageService.cs +++ b/GitTrends/Services/LanguageService.cs @@ -10,7 +10,7 @@ namespace GitTrends { public class LanguageService { - readonly static WeakEventManager _preferredLanguageChangedEventManager = new(); + static readonly WeakEventManager _preferredLanguageChangedEventManager = new(); readonly IMainThread _mainThread; readonly IPreferences _preferences; diff --git a/GitTrends/Services/MediaElementService.cs b/GitTrends/Services/MediaElementService.cs index 6ed3bd312..e5db026ff 100644 --- a/GitTrends/Services/MediaElementService.cs +++ b/GitTrends/Services/MediaElementService.cs @@ -11,7 +11,7 @@ namespace GitTrends { public class MediaElementService { - readonly static WeakEventManager _streamingManifestChangedEventManager = new(); + static readonly WeakEventManager _streamingManifestChangedEventManager = new(); readonly IDeviceInfo _deviceInfo; readonly IPreferences _preferences; diff --git a/GitTrends/Services/NotificationService.cs b/GitTrends/Services/NotificationService.cs index 0f0f0dd7c..551a7037b 100644 --- a/GitTrends/Services/NotificationService.cs +++ b/GitTrends/Services/NotificationService.cs @@ -18,9 +18,9 @@ public class NotificationService { const string _getNotificationHubInformationKey = "GetNotificationHubInformation"; - readonly static WeakEventManager _sortingOptionRequestedEventManager = new(); - readonly static WeakEventManager _initializationCompletedEventManager = new(); - readonly static WeakEventManager<(bool isSuccessful, string errorMessage)> _registerForNotificationCompletedEventHandler = new(); + static readonly WeakEventManager _sortingOptionRequestedEventManager = new(); + static readonly WeakEventManager _initializationCompletedEventManager = new(); + static readonly WeakEventManager<(bool isSuccessful, string errorMessage)> _registerForNotificationCompletedEventHandler = new(); readonly IDeviceInfo _deviceInfo; readonly IPreferences _preferences; diff --git a/GitTrends/Services/ReviewService.cs b/GitTrends/Services/ReviewService.cs index cabaa888a..4132ab802 100644 --- a/GitTrends/Services/ReviewService.cs +++ b/GitTrends/Services/ReviewService.cs @@ -13,7 +13,7 @@ public class ReviewService public const int MinimumAppInstallDays = 14; public const int MinimumMostRecentRequestDays = 90; - readonly static AsyncAwaitBestPractices.WeakEventManager _reviewPromptRequestedEventManager = new(); + static readonly AsyncAwaitBestPractices.WeakEventManager _reviewPromptRequestedEventManager = new(); readonly IAppInfo _appInfo; readonly IStoreReview _storeReview; diff --git a/GitTrends/Services/SyncfusionService.cs b/GitTrends/Services/SyncfusionService.cs index d9bea4f67..9232fc1ea 100644 --- a/GitTrends/Services/SyncfusionService.cs +++ b/GitTrends/Services/SyncfusionService.cs @@ -8,8 +8,8 @@ namespace GitTrends { public class SyncfusionService { - readonly static Lazy _assemblyVersionNumberHolder = new(() => long.Parse(System.Reflection.Assembly.GetAssembly(typeof(Syncfusion.CoreAssembly)).GetName().Version.ToString().Replace(".", ""))); - readonly static Lazy _syncfusionLicenseKeyHolder = new(() => $"{nameof(SyncFusionDTO.LicenseKey)}{_assemblyVersionNumberHolder.Value}"); + static readonly Lazy _assemblyVersionNumberHolder = new(() => long.Parse(System.Reflection.Assembly.GetAssembly(typeof(Syncfusion.CoreAssembly)).GetName().Version.ToString().Replace(".", ""))); + static readonly Lazy _syncfusionLicenseKeyHolder = new(() => $"{nameof(SyncFusionDTO.LicenseKey)}{_assemblyVersionNumberHolder.Value}"); readonly ISecureStorage _secureStorage; readonly IAnalyticsService _analyticsService; diff --git a/GitTrends/Services/ThemeService.cs b/GitTrends/Services/ThemeService.cs index f4b5f54bc..e5f234fc9 100644 --- a/GitTrends/Services/ThemeService.cs +++ b/GitTrends/Services/ThemeService.cs @@ -12,7 +12,7 @@ namespace GitTrends { public class ThemeService { - readonly static WeakEventManager _preferenceChangedEventManager = new(); + static readonly WeakEventManager _preferenceChangedEventManager = new(); readonly IMainThread _mainThread; readonly IPreferences _preferences; diff --git a/GitTrends/Services/UITestsBackdoorService.cs b/GitTrends/Services/UITestsBackdoorService.cs index 803e1fb0d..4a22ad789 100644 --- a/GitTrends/Services/UITestsBackdoorService.cs +++ b/GitTrends/Services/UITestsBackdoorService.cs @@ -17,8 +17,8 @@ namespace GitTrends { public class UITestsBackdoorService { - readonly static AsyncAwaitBestPractices.WeakEventManager _popPageStartedEventManager = new(); - readonly static WeakEventManager _popPageCompletedEventManager = new(); + static readonly AsyncAwaitBestPractices.WeakEventManager _popPageStartedEventManager = new(); + static readonly WeakEventManager _popPageCompletedEventManager = new(); readonly IMainThread _mainThread; readonly IStoreReview _storeReview; diff --git a/GitTrends/ViewModels/Base/GitHubAuthenticationViewModel.cs b/GitTrends/ViewModels/Base/GitHubAuthenticationViewModel.cs index 59d15e2c1..0ea921627 100644 --- a/GitTrends/ViewModels/Base/GitHubAuthenticationViewModel.cs +++ b/GitTrends/ViewModels/Base/GitHubAuthenticationViewModel.cs @@ -54,7 +54,7 @@ protected virtual Task HandleDemoButtonTapped(string? buttonText) } [RelayCommand(CanExecute = nameof(IsNotAuthenticating))] - protected async virtual Task HandleConnectToGitHubButton((CancellationToken cancellationToken, Xamarin.Essentials.BrowserLaunchOptions? browserLaunchOptions) parameter) + protected virtual async Task HandleConnectToGitHubButton((CancellationToken cancellationToken, Xamarin.Essentials.BrowserLaunchOptions? browserLaunchOptions) parameter) { var (cancellationToken, browserLaunchOptions) = parameter; diff --git a/GitTrends/ViewModels/OnboardingViewModel.cs b/GitTrends/ViewModels/OnboardingViewModel.cs index 5233f55df..d46488efd 100644 --- a/GitTrends/ViewModels/OnboardingViewModel.cs +++ b/GitTrends/ViewModels/OnboardingViewModel.cs @@ -11,7 +11,7 @@ namespace GitTrends { public partial class OnboardingViewModel : GitHubAuthenticationViewModel { - readonly static WeakEventManager _skipButtonTappedEventManager = new(); + static readonly WeakEventManager _skipButtonTappedEventManager = new(); readonly IAnalyticsService _analyticsService; readonly NotificationService _notificationService; diff --git a/GitTrends/ViewModels/ReferringSitesViewModel.cs b/GitTrends/ViewModels/ReferringSitesViewModel.cs index 902f48f6b..48fe64816 100644 --- a/GitTrends/ViewModels/ReferringSitesViewModel.cs +++ b/GitTrends/ViewModels/ReferringSitesViewModel.cs @@ -18,8 +18,8 @@ namespace GitTrends { public partial class ReferringSitesViewModel : BaseViewModel { - readonly static WeakEventManager _pullToRefreshFailedEventManager = new(); - readonly static WeakEventManager _abuseRateLimitFound_GetReferringSites_EventManager = new(); + static readonly WeakEventManager _pullToRefreshFailedEventManager = new(); + static readonly WeakEventManager _abuseRateLimitFound_GetReferringSites_EventManager = new(); readonly GitHubUserService _gitHubUserService; readonly ReferringSitesDatabase _referringSitesDatabase; diff --git a/GitTrends/ViewModels/RepositoryViewModel.cs b/GitTrends/ViewModels/RepositoryViewModel.cs index 9c51b8f65..b756035aa 100644 --- a/GitTrends/ViewModels/RepositoryViewModel.cs +++ b/GitTrends/ViewModels/RepositoryViewModel.cs @@ -20,7 +20,7 @@ namespace GitTrends { public partial class RepositoryViewModel : BaseViewModel { - readonly static WeakEventManager _pullToRefreshFailedEventManager = new(); + static readonly WeakEventManager _pullToRefreshFailedEventManager = new(); readonly GitHubUserService _gitHubUserService; readonly RepositoryDatabase _repositoryDatabase; diff --git a/GitTrends/ViewModels/SettingsViewModel.cs b/GitTrends/ViewModels/SettingsViewModel.cs index 004279b05..3ea88eacb 100644 --- a/GitTrends/ViewModels/SettingsViewModel.cs +++ b/GitTrends/ViewModels/SettingsViewModel.cs @@ -16,8 +16,8 @@ namespace GitTrends { public partial class SettingsViewModel : GitHubAuthenticationViewModel { - readonly static WeakEventManager _organizationsCarouselViewVisiblilityChangedEventManager = new(); - readonly static WeakEventManager _setNotificationsPreferenceCompletedEventManager = new(); + static readonly WeakEventManager _organizationsCarouselViewVisiblilityChangedEventManager = new(); + static readonly WeakEventManager _setNotificationsPreferenceCompletedEventManager = new(); readonly ThemeService _themeService; readonly LanguageService _languageService; diff --git a/GitTrends/ViewModels/TrendsViewModel.cs b/GitTrends/ViewModels/TrendsViewModel.cs index 546a8e357..54c221b0e 100644 --- a/GitTrends/ViewModels/TrendsViewModel.cs +++ b/GitTrends/ViewModels/TrendsViewModel.cs @@ -21,7 +21,7 @@ public partial class TrendsViewModel : BaseViewModel { public const int MinimumChartHeight = 20; - readonly static WeakEventManager _repostoryEventManager = new(); + static readonly WeakEventManager _repostoryEventManager = new(); readonly GitHubApiV3Service _gitHubApiV3Service; readonly RepositoryDatabase _repositoryDatabase; diff --git a/GitTrends/Views/About/ContributorDataTemplate.cs b/GitTrends/Views/About/ContributorDataTemplate.cs index a40559b81..c5d37e667 100644 --- a/GitTrends/Views/About/ContributorDataTemplate.cs +++ b/GitTrends/Views/About/ContributorDataTemplate.cs @@ -12,7 +12,7 @@ class ContributorDataTemplate : DataTemplate const int _loginTextHeight = 25; const int _textPadding = 4; - readonly static int _circleDiameter = IsSmallScreen ? 54 : 64; + static readonly int _circleDiameter = IsSmallScreen ? 54 : 64; public ContributorDataTemplate() : base(CreateContributorDataTemplate) { diff --git a/GitTrends/Views/About/LibraryDataTemplate.cs b/GitTrends/Views/About/LibraryDataTemplate.cs index 1ec7ff752..5188a7094 100644 --- a/GitTrends/Views/About/LibraryDataTemplate.cs +++ b/GitTrends/Views/About/LibraryDataTemplate.cs @@ -12,7 +12,7 @@ class LibraryDataTemplate : DataTemplate const int _loginTextHeight = 24; const int _textPadding = 8; - readonly static int _circleDiameter = IsSmallScreen ? 54 : 64; + static readonly int _circleDiameter = IsSmallScreen ? 54 : 64; public LibraryDataTemplate() : base(CreateLibraryDataTemplate) { diff --git a/GitTrends/Views/Repository/BaseRepositoryDataTemplate.cs b/GitTrends/Views/Repository/BaseRepositoryDataTemplate.cs index 929a807c7..2e1cb4138 100644 --- a/GitTrends/Views/Repository/BaseRepositoryDataTemplate.cs +++ b/GitTrends/Views/Repository/BaseRepositoryDataTemplate.cs @@ -19,7 +19,7 @@ abstract class BaseRepositoryDataTemplate : DataTemplate const double _statisticsRowHeight = StatisticsLabel.StatisticsFontSize + 4; const double _emojiColumnSize = _statisticsRowHeight; - readonly static double _circleImageHeight = IsSmallScreen ? 48 : 62; + static readonly double _circleImageHeight = IsSmallScreen ? 48 : 62; private protected BaseRepositoryDataTemplate(Func loadTemplate) : base(loadTemplate) {