Skip to content

Commit

Permalink
Automated dotnet-format update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 7, 2020
1 parent ca46320 commit 4da8e8a
Show file tree
Hide file tree
Showing 335 changed files with 804 additions and 806 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DryIocContainerExtension : IContainerExtension<IContainer>, IContainerInfo
/// <summary>
/// Gets the Default DryIoc Container Rules used by Prism
/// </summary>
public static Rules DefaultRules => Rules.Default.WithConcreteTypeDynamicRegistrations(reuse:Reuse.Transient)
public static Rules DefaultRules => Rules.Default.WithConcreteTypeDynamicRegistrations(reuse: Reuse.Transient)
.With(Made.Of(FactoryMethod.ConstructorWithResolvableArguments))
.WithFuncAndLazyWithoutRegistration()
.WithTrackingDisposableTransients()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public object Resolve(Type type, params (Type Type, object Instance)[] parameter
var c = _currentScope?.Container ?? Instance;
var overrides = parameters.Select(p => new DependencyOverride(p.Type, p.Instance)).ToArray();

if(typeof(IEnumerable).IsAssignableFrom(type) && type.GetGenericArguments().Length > 0)
if (typeof(IEnumerable).IsAssignableFrom(type) && type.GetGenericArguments().Length > 0)
{
type = type.GetGenericArguments()[0];
return c.ResolveAll(type, overrides);
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/Prism.DryIoc.Forms/PrismApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ protected override IContainerExtension CreateContainerExtension()
/// <returns>An instance of <see cref="Rules" /></returns>
protected virtual Rules CreateContainerRules() => DryIocContainerExtension.DefaultRules;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ protected override void OnDetachingFrom(Page bindable)
if (Region != null)
{
var manager = Region.RegionManager ?? ContainerLocator.Container.Resolve<IRegionManager>();
if(manager.Regions.ContainsRegionWithName(Region.Name))
if (manager.Regions.ContainsRegionWithName(Region.Name))
{
manager.Regions.Remove(Region.Name);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Forms/Prism.Forms.Regions/Extensions/ElementExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public static bool CheckForParentPage(this VisualElement visualElement)

public static Element GetRoot(this Element element)
{
switch(element.Parent)
switch (element.Parent)
{
case null:
return element;
Expand All @@ -22,7 +22,7 @@ public static Element GetRoot(this Element element)

public static Page GetParentPage(this Element visualElement)
{
switch(visualElement.Parent)
switch (visualElement.Parent)
{
case Page page:
return page;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public static class RegionNavigationRegistrationExtensions
/// <typeparam name="TView">The Type of <see cref="View"/> to register</typeparam>
/// <param name="containerRegistry"><see cref="IContainerRegistry"/> used to register type for Navigation.</param>
/// <param name="name">The unique name to register with the View</param>
public static void RegisterForRegionNavigation<TView>(this IContainerRegistry containerRegistry, string name = null)
public static void RegisterForRegionNavigation<TView>(this IContainerRegistry containerRegistry, string name = null)
where TView : View
{
var viewType = typeof(TView);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ protected override void OnDetachingFrom(CarouselView carousel)

private void OnCurrentItemChanged(object sender, CurrentItemChangedEventArgs e)
{
if(sender is CarouselView carousel && carousel.CurrentItem != CurrentView && carousel.CurrentItem != null && carousel.CurrentItem is VisualElement newActiveView)
if (sender is CarouselView carousel && carousel.CurrentItem != CurrentView && carousel.CurrentItem != null && carousel.CurrentItem is VisualElement newActiveView)
{
var previousView = CurrentView;
CurrentView = newActiveView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ private void UnWireTargetElement()

private void TargetElement_ParentChanged(object sender, PropertyChangedEventArgs e)
{
if(e.PropertyName == nameof(VisualElement.Parent) && TargetElement?.Parent != null)
if (e.PropertyName == nameof(VisualElement.Parent) && TargetElement?.Parent != null)
{
UnWireTargetElement();
TryCreateRegion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public IRegionBehavior CreateFromKey(string key)
/// A <see cref="T:System.Collections.Generic.IEnumerator`1" /> that can be used to iterate through the collection.
/// </returns>
/// <filterpriority>1</filterpriority>
public IEnumerator<string> GetEnumerator() =>
public IEnumerator<string> GetEnumerator() =>
_registeredBehaviors.Keys.GetEnumerator();

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void OnUpdatingRegions(object sender, EventArgs e)

private IRegionManager FindRegionManager(Element element)
{
if(element is VisualElement visualElement)
if (element is VisualElement visualElement)
{
var regionmanager = RegionManagerAccessor.GetRegionManager(visualElement);
if (regionmanager != null)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public IRegionManager GetRegionManager(VisualElement element)
throw new ArgumentNullException(nameof(element));

var regionManager = TryGetRegion(element);
if(regionManager is null)
if (regionManager is null)
{
regionManager = ContainerLocator.Container.Resolve<IRegionManager>();
element.SetValue(Xaml.RegionManager.RegionManagerProperty, regionManager);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ public static string NavigatedName(this INavigationContext context)
return uri.LocalPath.StartsWith("/") ? uri.LocalPath.Substring(1) : uri.LocalPath;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ public interface IRegionNavigationContentLoader
/// <exception cref="InvalidOperationException">when a new item cannot be created for the navigation request.</exception>
object LoadContent(IRegion region, INavigationContext navigationContext);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ public interface IRegionNavigationJournal
/// </summary>
void Clear();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ public interface IRegionNavigationJournalEntry
/// </summary>
INavigationParameters Parameters { get; set; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ public interface IRegionNavigationResult
/// <value>The result.</value>
bool? Result { get; }
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public NavigationContext(IRegionNavigationService navigationService, Uri uri, IN
Parameters = regionParameters ?? new NavigationParameters();

var queryString = uri != null ? UriParsingHelper.EnsureAbsolute(uri).Query : null;
if(!string.IsNullOrEmpty(queryString))
if (!string.IsNullOrEmpty(queryString))
{
UpdateRegionParameters(new NavigationParameters(queryString));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ protected virtual object CreateNewRegionItem(string candidateTargetContract)

newRegionItem = view;
}
catch(ContainerResolutionException)
catch (ContainerResolutionException)
{
throw;
}
Expand Down Expand Up @@ -161,4 +161,4 @@ private static bool ViewIsMatch(Type viewType, string navigationSegment)
return names.Any(x => x.Equals(navigationSegment, StringComparison.Ordinal));
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,4 @@ private void InternalNavigate(IRegionNavigationJournalEntry entry, Action<bool>
entry.Parameters);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public override string ToString()
return base.ToString();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ public RegionNavigationResult(INavigationContext context, Exception error)
/// <value>The navigation context.</value>
public INavigationContext Context { get; }
}
}
}
2 changes: 1 addition & 1 deletion src/Forms/Prism.Forms.Regions/Regions/RegionCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public IEnumerator<IRegion> GetEnumerator()
return _regions.GetEnumerator();
}

IEnumerator IEnumerable.GetEnumerator() =>
IEnumerator IEnumerable.GetEnumerator() =>
GetEnumerator();

public IRegion this[string regionName]
Expand Down
4 changes: 2 additions & 2 deletions src/Forms/Prism.Forms.Regions/Regions/Xaml/RegionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static class RegionManager
/// will create and adapt a new region for that control, and register it
/// in the <see cref="IRegionManager"/> with the specified region name.
/// </remarks>
public static readonly BindableProperty RegionNameProperty =
public static readonly BindableProperty RegionNameProperty =
BindableProperty.CreateAttached("RegionName", typeof(string), typeof(RegionManager), null, propertyChanged: OnSetRegionNameCallback);

/// <summary>
Expand Down Expand Up @@ -107,7 +107,7 @@ public static ObservableObject<IRegion> GetObservableRegion(VisualElement view)

private static void OnSetRegionNameCallback(BindableObject bindable, object oldValue, object newValue)
{
if(!DesignMode.IsDesignModeEnabled && bindable is VisualElement view)
if (!DesignMode.IsDesignModeEnabled && bindable is VisualElement view)
{
CreateRegion(view);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/Prism.Forms/AppModel/AutoInitializeAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public sealed class AutoInitializeAttribute : Attribute
/// Provides a custom name for <see cref="IAutoInitialize"/> to use
/// </summary>
/// <param name="name">The custom name to use</param>
public AutoInitializeAttribute(string name): this(name, false) { }
public AutoInitializeAttribute(string name) : this(name, false) { }

/// <summary>
/// Marks a property as required if <c>true</c>
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/Prism.Forms/Behaviors/EventToCommandBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -249,4 +249,4 @@ protected virtual void OnEventRaised(object sender, EventArgs eventArgs)
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Prism.Common;
using System;
using Prism.Common;
using Prism.Navigation;
using System;
using Xamarin.Forms;

namespace Prism.Behaviors
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private void NavigationPage_Popped(object sender, NavigationEventArgs e)
if (PageNavigationService.NavigationSource == PageNavigationSource.Device)
{
PageUtilities.HandleSystemGoBack(e.Page, AssociatedObject.CurrentPage);
}
}
}
}
}
4 changes: 2 additions & 2 deletions src/Forms/Prism.Forms/Common/IPageAware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ public interface IPageAware
/// <summary>
/// The <see cref="Xamarin.Forms.Page"/> instance.
/// </summary>
Page Page { get; set; }
Page Page { get; set; }
}
}
}
16 changes: 8 additions & 8 deletions src/Forms/Prism.Forms/Common/PageUtilities.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using Prism.AppModel;
using Prism.Mvvm;
using Prism.Navigation;
using System;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Threading.Tasks;
using Prism.AppModel;
using Prism.Mvvm;
using Prism.Navigation;
using Xamarin.Forms;

namespace Prism.Common
Expand Down Expand Up @@ -58,7 +58,7 @@ public static void DestroyPage(Page page)

private static void DestroyChildren(Page page)
{
switch(page)
switch (page)
{
case MasterDetailPage mdp:
DestroyPage(mdp.Master);
Expand Down Expand Up @@ -144,11 +144,11 @@ internal static void Abracadabra(object page, IEnumerable<KeyValuePair<string, o
.GetProperties(BindingFlags.Instance | BindingFlags.Public)
.Where(x => x.CanWrite);

foreach(var prop in props)
foreach (var prop in props)
{
(var name, var isRequired) = prop.GetAutoInitializeProperty();

if(!parameters.HasKey(name, out var key))
if (!parameters.HasKey(name, out var key))
{
if (isRequired)
throw new ArgumentNullException(name);
Expand All @@ -168,7 +168,7 @@ private static bool HasKey(this IEnumerable<KeyValuePair<string, object>> parame
private static (string Name, bool IsRequired) GetAutoInitializeProperty(this PropertyInfo pi)
{
var attr = pi.GetCustomAttribute<AutoInitializeAttribute>();
if(attr is null)
if (attr is null)
{
return (pi.Name, false);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Forms/Prism.Forms/Common/UriParsingHelper.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Prism.Navigation;
using Prism.Services.Dialogs;
using System;
using System;
using System.Collections.Generic;
using Prism.Navigation;
using Prism.Services.Dialogs;

namespace Prism.Common
{
Expand Down
8 changes: 4 additions & 4 deletions src/Forms/Prism.Forms/Ioc/IContainerRegistryExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Prism.Mvvm;
using Prism.Navigation;
using System;
using System;
using System.Linq;
using Prism.Mvvm;
using Prism.Navigation;
using Xamarin.Forms;

namespace Prism.Ioc
Expand Down Expand Up @@ -127,7 +127,7 @@ public static void RegisterForNavigationOnPlatform<TView, TViewModel>(this ICont
if (string.IsNullOrWhiteSpace(name))
name = typeof(TView).Name;

if(platforms.Any(x => x.RuntimePlatform.ToString() == Device.RuntimePlatform))
if (platforms.Any(x => x.RuntimePlatform.ToString() == Device.RuntimePlatform))
{
var platform = platforms.First(x => x.RuntimePlatform.ToString() == Device.RuntimePlatform);
containerRegistry.RegisterForNavigationWithViewModel<TViewModel>(platform.ViewType, name);
Expand Down
2 changes: 1 addition & 1 deletion src/Forms/Prism.Forms/Ioc/TypeAutoLoadExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static void RegisterView(IContainerRegistry containerRegistry, Type view

var name = AutoRegistrationViewNameProvider.GetNavigationSegmentName(viewType);

if(!checkIfRegistered || !containerRegistry.IsRegistered<object>(name))
if (!checkIfRegistered || !containerRegistry.IsRegistered<object>(name))
{
containerRegistry.RegisterForNavigation(viewType, name);
}
Expand Down
4 changes: 2 additions & 2 deletions src/Forms/Prism.Forms/Modularity/ModuleInitializer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using Prism.Ioc;
using System;
using System;
using Prism.Ioc;

namespace Prism.Modularity
{
Expand Down
4 changes: 2 additions & 2 deletions src/Forms/Prism.Forms/Modularity/ModuleManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public void LoadModule(string moduleName)
{
throw new ModuleNotFoundException(moduleName, string.Format(CultureInfo.CurrentCulture, Resources.ModuleNotFound, moduleName));
}
else if(modules.Count() > 1)
else if (modules.Count() > 1)
{
throw new DuplicateModuleException(moduleName, string.Format(CultureInfo.CurrentCulture, Resources.DuplicatedModuleInCatalog, moduleName));
}
Expand Down Expand Up @@ -112,7 +112,7 @@ protected virtual void LoadModules(IEnumerable<IModuleInfo> moduleInfos)
{
RaiseLoadModuleCompleted(moduleInfo, ex);
}

}
}
}
Expand Down
Loading

0 comments on commit 4da8e8a

Please sign in to comment.