From cdda48351cac91db2f061ee811af1c3fe0269153 Mon Sep 17 00:00:00 2001 From: Nick Randolph Date: Wed, 14 Mar 2018 10:59:03 +1100 Subject: [PATCH] Adjusting line endings --- .editorconfig | 8 ++++---- MvvmCross/Core/MvxSetup.cs | 35 +++++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 16 deletions(-) diff --git a/.editorconfig b/.editorconfig index fcee41be8..8653f7fd8 100644 --- a/.editorconfig +++ b/.editorconfig @@ -72,9 +72,9 @@ csharp_style_throw_expression = true:suggestion csharp_style_conditional_delegate_call = true:suggestion # Newline settings -csharp_new_line_before_open_brace = anonymous_types,accessors,object_collection_array_initalizers,methods,properties,types -csharp_new_line_before_else = false -csharp_new_line_before_catch = false -csharp_new_line_before_finally = false +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true csharp_new_line_before_members_in_object_initializers = true csharp_new_line_before_members_in_anonymous_types = true diff --git a/MvvmCross/Core/MvxSetup.cs b/MvvmCross/Core/MvxSetup.cs index 2ad504d51..9f93d2a08 100644 --- a/MvvmCross/Core/MvxSetup.cs +++ b/MvvmCross/Core/MvxSetup.cs @@ -22,7 +22,7 @@ namespace MvvmCross.Core public abstract class MvxSetup { protected static Type RegisteredSetupType { get; set; } - public static void RegisterSetupType() where TMvxSetup: MvxSetup,new() + public static void RegisterSetupType() where TMvxSetup : MvxSetup, new() { RegisteredSetupType = typeof(TMvxSetup); } @@ -33,16 +33,19 @@ namespace MvvmCross.Core get { if (instance != null) return instance; - if (RegisteredSetupType != null) { + if (RegisteredSetupType != null) + { instance = Activator.CreateInstance(RegisteredSetupType) as MvxSetup; - } else { + } + else + { instance = MvxSetupExtensions.CreateSetup(); } return instance; } } - public static TMvxSetup PlatformInstance() where TMvxSetup:MvxSetup + public static TMvxSetup PlatformInstance() where TMvxSetup : MvxSetup { return Instance as TMvxSetup; } @@ -63,7 +66,8 @@ namespace MvvmCross.Core public virtual void InitializePrimary() { - if (State != MvxSetupState.Uninitialized) { + if (State != MvxSetupState.Uninitialized) + { throw new MvxException("Cannot start primary - as state already {0}", State); } State = MvxSetupState.InitializingPrimary; @@ -71,7 +75,8 @@ namespace MvvmCross.Core InitializeLoggingServices(); SetupLog.Trace("Setup: Primary start"); State = MvxSetupState.InitializedPrimary; - if (State != MvxSetupState.InitializedPrimary) { + if (State != MvxSetupState.InitializedPrimary) + { throw new MvxException("Cannot start seconday - as state is currently {0}", State); } State = MvxSetupState.InitializingSecondary; @@ -171,7 +176,8 @@ namespace MvvmCross.Core protected virtual void PerformBootstrapActions() { var bootstrapRunner = new MvxBootstrapRunner(); - foreach (var assembly in GetBootstrapOwningAssemblies()) { + foreach (var assembly in GetBootstrapOwningAssemblies()) + { bootstrapRunner.Run(assembly); } } @@ -228,7 +234,8 @@ namespace MvvmCross.Core protected virtual void InitializeLoggingServices() { var logProvider = CreateLogProvider(); - if (logProvider != null) { + if (logProvider != null) + { Mvx.RegisterSingleton(logProvider); SetupLog = logProvider.GetLogFor(); var globalLog = logProvider.GetLogFor(); @@ -242,7 +249,8 @@ namespace MvvmCross.Core protected virtual IMvxLogProvider CreateLogProvider() { - switch (GetDefaultLogProviderType()) { + switch (GetDefaultLogProviderType()) + { case MvxLogProviderType.Console: return new ConsoleLogProvider(); case MvxLogProviderType.EntLib: @@ -306,7 +314,8 @@ namespace MvvmCross.Core .SelectMany(assembly => assembly.GetTypes()) .Where(TypeContainsPluginAttribute); - foreach (var pluginType in pluginTypes) { + foreach (var pluginType in pluginTypes) + { pluginManager.EnsurePluginLoaded(pluginType); } @@ -397,7 +406,8 @@ namespace MvvmCross.Core Mvx.RegisterSingleton(viewModelByNameRegistry); var viewModelAssemblies = GetViewModelAssemblies(); - foreach (var assembly in viewModelAssemblies) { + foreach (var assembly in viewModelAssemblies) + { viewModelByNameRegistry.AddAll(assembly); } @@ -480,7 +490,8 @@ namespace MvvmCross.Core public virtual void EnsureInitialized(Type requiredBy) { - switch (State) { + switch (State) + { case MvxSetupState.Uninitialized: Initialize(); break;