Skip to content

Commit

Permalink
chore: update code format
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Sep 10, 2023
1 parent 2838d27 commit db3f1c8
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 30 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Adapters;
using Prism.Navigation.Regions.Behaviors;
using Prism.Navigation.Regions.Navigation;
using Prism.Navigation.Regions;
using Xamarin.Forms;

namespace Prism.Ioc
Expand Down
12 changes: 6 additions & 6 deletions src/Maui/Prism.Maui/Common/MvvmHelpers.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.ComponentModel;
using System.Reflection;
using Prism.Navigation;
using Prism.Navigation.Xaml;
using Prism.Navigation.Regions;
using Prism.Navigation.Xaml;
using NavigationMode = Prism.Navigation.NavigationMode;
using TabbedPage = Microsoft.Maui.Controls.TabbedPage;

Expand All @@ -22,10 +22,10 @@ public static void InvokeViewAndViewModelAction<T>(object view, Action<T> action
action(viewModelAsT);
}

if(view is Page page)
if (view is Page page)
{
var children = page.GetChildRegions();
if(children is not null)
if (children is not null)
foreach (var child in children)
InvokeViewAndViewModelAction<T>(child, action);
}
Expand All @@ -46,7 +46,7 @@ public static async Task InvokeViewAndViewModelActionAsync<T>(object view, Func<
if (view is Page page)
{
var children = page.GetChildRegions();
if(children is not null)
if (children is not null)
foreach (var child in children)
await InvokeViewAndViewModelActionAsync<T>(child, action);
}
Expand All @@ -60,7 +60,7 @@ public static void DestroyPage(IView view)

InvokeViewAndViewModelAction<IDestructible>(view, v => v.Destroy());

if(view is Page page)
if (view is Page page)
{
page.Behaviors?.Clear();
page.BindingContext = null;
Expand Down Expand Up @@ -301,7 +301,7 @@ public static async Task HandleNavigationPageGoBack(NavigationPage navigationPag
{
var navigationService = Navigation.Xaml.Navigation.GetNavigationService(navigationPage.CurrentPage);
var result = await navigationService.GoBackAsync();
if(result.Exception is NavigationException navEx && navEx.Message == NavigationException.CannotPopApplicationMainPage)
if (result.Exception is NavigationException navEx && navEx.Message == NavigationException.CannotPopApplicationMainPage)
{
Application.Current.Quit();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Maui/Prism.Maui/Common/ObservableObject.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ public T Value
get => (T)GetValue(ValueProperty);
set => SetValue(ValueProperty, value);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
using Microsoft.Maui.Controls.Compatibility;
using Microsoft.Maui.Controls.Compatibility;
using Prism.Mvvm;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Adapters;
using Prism.Navigation.Regions.Behaviors;
using Prism.Navigation.Regions.Navigation;
using Prism.Navigation.Regions;

namespace Prism.Ioc;

Expand Down
2 changes: 1 addition & 1 deletion src/Maui/Prism.Maui/Navigation/Xaml/GoBackExtension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ await navigationService.GoBackToRootAsync(parameters) :
Log(result.Exception, parameters);
}
}
}
}
1 change: 0 additions & 1 deletion src/Prism.Core/Navigation/Regions/INavigateAsync.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System;
using Prism.Navigation;

namespace Prism.Navigation.Regions
{
Expand Down
1 change: 0 additions & 1 deletion src/Prism.Core/Navigation/Regions/IRegionBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ public interface IRegionBehavior
/// Attaches the behavior to the specified region.
/// </summary>
void Attach();

}
}
4 changes: 2 additions & 2 deletions src/Prism.Core/Navigation/Regions/IRegionCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ public interface IRegionCollection : IEnumerable<IRegion>, INotifyCollectionChan
bool ContainsRegionWithName(string regionName);

/// <summary>
/// Adds a region to the <see cref="RegionManager"/> with the name received as argument.
/// Adds a region to the <see cref="IRegionManager"/> with the name received as argument.
/// </summary>
/// <param name="regionName">The name to be given to the region.</param>
/// <param name="region">The region to be added to the <see cref="RegionManager"/>.</param>
/// <param name="region">The region to be added to the <see cref="IRegionManager"/>.</param>
/// <exception cref="ArgumentNullException">Thrown if <paramref name="region"/> is <see langword="null"/>.</exception>
/// <exception cref="ArgumentException">Thrown if <paramref name="regionName"/> and <paramref name="region"/>'s name do not match and the <paramref name="region"/> <see cref="IRegion.Name"/> is not <see langword="null"/>.</exception>
void Add(string regionName, IRegion region);
Expand Down
8 changes: 4 additions & 4 deletions src/Prism.Core/Navigation/Regions/UpdateRegionsException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public UpdateRegionsException(string message, Exception inner)
}

/// <summary>
/// Initializes a new instance of the <see cref="UpdateRegionsException"/> class with serialized data.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
/// Initializes a new instance of the <see cref="UpdateRegionsException"/> class with serialized data.
/// </summary>
/// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
/// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
protected UpdateRegionsException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
using System;
using System;
using System.Collections.Generic;
using System.Text;
using Moq;
using Prism.Ioc;
using Prism.Ioc.Internals;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Navigation;
using Prism.Navigation.Regions;
using Xamarin.Forms;
using Xunit;
using Region = Prism.Navigation.Regions.Region;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Text;
using Prism.Forms.Regions.Mocks;
using Prism.Navigation.Regions.Adapters;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Adapters;
using Xamarin.Forms;
using Xunit;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
using System.Collections.Generic;
using System.Linq;
using Moq;
using NuGet.Frameworks;
using Prism.Ioc;
using Prism.Navigation;
using Prism.Navigation.Regions.Navigation;
using Prism.Navigation.Regions;
using Prism.Navigation.Regions.Navigation;
using Prism.Navigation.Regions.Navigation;
using Xamarin.Forms;
using Xunit;
using Region = Prism.Navigation.Regions.Region;
using NuGet.Frameworks;

namespace Prism.Forms.Regions.Tests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void CollectionChangedPassesWrappedItemInArgumentsWhenAdding()
originalCollection.Remove(filteredInObject);

Assert.NotNull(oldItemsPassed);
Assert.Equal(1, oldItemsPassed.Count);
Assert.Single(oldItemsPassed);
Assert.Same(filteredInObject.Item, oldItemsPassed[0]);
}

Expand All @@ -133,7 +133,7 @@ public void CollectionChangedPassesWrappedItemInArgumentsWhenRemoving()
originalCollection.Add(filteredInObject);

Assert.NotNull(newItemsPassed);
Assert.Equal(1, newItemsPassed.Count);
Assert.Single(newItemsPassed);
Assert.Same(filteredInObject.Item, newItemsPassed[0]);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public void RegionViewModel_HasPageAccessor_WithCorrectPage()
[Fact]
public void RegionManager_HasTwoRegions()
{
var mauiApp = CreateBuilder(prism =>
var mauiApp = CreateBuilder(prism =>
prism.RegisterTypes(container =>
{
container.RegisterForNavigation<MockContentRegionPage, MockContentRegionPageViewModel>();
Expand Down
4 changes: 2 additions & 2 deletions tests/Wpf/Prism.Wpf.Tests/Regions/ViewsCollectionFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void CollectionChangedPassesWrappedItemInArgumentsWhenAdding()
originalCollection.Remove(filteredInObject);

Assert.NotNull(oldItemsPassed);
Assert.Equal(1, oldItemsPassed.Count);
Assert.Single(oldItemsPassed);
Assert.Same(filteredInObject.Item, oldItemsPassed[0]);
}

Expand All @@ -133,7 +133,7 @@ public void CollectionChangedPassesWrappedItemInArgumentsWhenRemoving()
originalCollection.Add(filteredInObject);

Assert.NotNull(newItemsPassed);
Assert.Equal(1, newItemsPassed.Count);
Assert.Single(newItemsPassed);
Assert.Same(filteredInObject.Item, newItemsPassed[0]);
}

Expand Down

0 comments on commit db3f1c8

Please sign in to comment.