Skip to content

Commit

Permalink
Fixed some CS1572, 1573, 1574 and 1591 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Geoffrey Dudics committed Apr 17, 2020
1 parent 07997a6 commit 2eb175e
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public static class INavigationServiceExtensions
/// <summary>
/// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack.
/// </summary>
/// <param name="navigationService">Service for handling navigation between views</param>
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync</param>
/// <param name="animated">If <c>true</c> the transition is animated, if <c>false</c> there is no animation on transition.</param>
Expand All @@ -37,6 +38,7 @@ public static Task<INavigationResult> GoBackToRootAsync(this INavigationService
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="name"/>.
/// </summary>
/// <param name="navigationService">Service for handling navigation between views</param>
/// <param name="name">The name of the target to navigate to.</param>
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PushModalAsync, if <c>false</c> uses PushAsync</param>
Expand All @@ -50,6 +52,7 @@ public static Task<INavigationResult> NavigateAsync(this INavigationService navi
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="uri"/>.
/// </summary>
/// <param name="navigationService">Service for handling navigation between views</param>
/// <param name="uri">The Uri to navigate to</param>
/// <param name="parameters">The navigation parameters</param>
/// <param name="useModalNavigation">If <c>true</c> uses PopModalAsync, if <c>false</c> uses PopAsync</param>
Expand Down Expand Up @@ -87,6 +90,7 @@ public static string GetNavigationUriPath(this INavigationService navigationServ
/// <summary>
/// Navigates to the most recent entry in the back navigation history by popping the calling Page off the navigation stack.
/// </summary>
/// <param name="navigationService">Service for handling navigation between views</param>
/// <param name="parameters">The navigation parameters</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
public static Task<INavigationResult> GoBackAsync(this INavigationService navigationService, params (string Key, object Value)[] parameters)
Expand All @@ -97,6 +101,7 @@ public static Task<INavigationResult> GoBackAsync(this INavigationService naviga
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="name"/>.
/// </summary>
/// <param name="navigationService">Service for handling navigation between views</param>
/// <param name="name">The Uri to navigate to</param>
/// <param name="parameters">The navigation parameters</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
Expand All @@ -112,6 +117,7 @@ public static Task<INavigationResult> NavigateAsync(this INavigationService navi
/// <summary>
/// Initiates navigation to the target specified by the <paramref name="uri"/>.
/// </summary>
/// <param name="navigationService">Service for handling navigation between views</param>
/// <param name="uri">The Uri to navigate to</param>
/// <param name="parameters">The navigation parameters</param>
/// <returns><see cref="INavigationResult"/> indicating whether the request was successful or if there was an encountered <see cref="Exception"/>.</returns>
Expand Down
1 change: 0 additions & 1 deletion src/Forms/Prism.Forms/Navigation/PageNavigationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ Task<INavigationResult> IPlatformNavigationService.GoBackToRootAsync(INavigation
/// <summary>
/// When navigating inside a NavigationPage: Pops all but the root Page off the navigation stack
/// </summary>
/// <param name="navigationService">The INavigatinService instance</param>
/// <param name="parameters">The navigation parameters</param>
/// <remarks>Only works when called from a View within a NavigationPage</remarks>
protected async virtual Task<INavigationResult> GoBackToRootInternal(INavigationParameters parameters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public static class INavigationServiceExtensions
/// <summary>
/// Selects a Tab of the TabbedPage parent.
/// </summary>
/// <param name="navigationService">Service for handling navigation between views</param>
/// <param name="name">The name of the tab to select</param>
/// <param name="parameters">The navigation parameters</param>
public static async Task<INavigationResult> SelectTabAsync(this INavigationService navigationService, string name, INavigationParameters parameters = null)
Expand Down
3 changes: 3 additions & 0 deletions src/Forms/Prism.Unity.Forms/PrismApplication.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
[assembly: Xamarin.Forms.XmlnsDefinition("http://prismlibrary.com", "Prism.Unity")]
namespace Prism.Unity
{
/// <summary>
/// Base class for PrismApplication
/// </summary>
public abstract class PrismApplication : PrismApplicationBase
{
/// <summary>
Expand Down
62 changes: 61 additions & 1 deletion src/Prism.Core/Common/ParametersBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,24 @@

namespace Prism.Common
{
/// <summary>
/// Base class for Navigation parameters
/// </summary>
public abstract class ParametersBase : IEnumerable<KeyValuePair<string, object>>
{
private readonly List<KeyValuePair<string, object>> _entries = new List<KeyValuePair<string, object>>();

/// <summary>
/// Default constructor
/// </summary>
protected ParametersBase()
{
}

/// <summary>
/// Constructs a list of parameters
/// </summary>
/// <param name="query">Query string to be parsed</param>
protected ParametersBase(string query)
{
if (!string.IsNullOrWhiteSpace(query))
Expand Down Expand Up @@ -58,6 +68,12 @@ protected ParametersBase(string query)
}
}

/// <summary>
/// Searches Parameter collection and returns value if Collection contains key.
/// Otherswise returns null.
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public object this[string key]
{
get
Expand All @@ -74,32 +90,72 @@ public object this[string key]
}
}

/// <summary>
/// The count, or number, of parameters in collection
/// </summary>
public int Count => _entries.Count;

/// <summary>
/// Returns an IEnumerable of the Keys in the collection
/// </summary>
public IEnumerable<string> Keys =>
_entries.Select(x => x.Key);

/// <summary>
/// Adds the KeyValuePair to the Collection
/// </summary>
/// <param name="key"></param>
/// <param name="value"></param>
public void Add(string key, object value) =>
_entries.Add(new KeyValuePair<string, object>(key, value));

/// <summary>
/// Checks collection for presense of key
/// </summary>
/// <param name="key"></param>
/// <returns>True if key exists; else returns false.</returns>
public bool ContainsKey(string key) =>
_entries.ContainsKey(key);

/// <summary>
/// Gets an enumerator for the KeyValuePairs in parameter collection
/// </summary>
/// <returns>Enumerator</returns>
public IEnumerator<KeyValuePair<string, object>> GetEnumerator() =>
_entries.GetEnumerator();

/// <summary>
/// Returns the value of the member referenced by key
/// </summary>
/// <typeparam name="T">The type of object to be returned</typeparam>
/// <param name="key"></param>
/// <returns></returns>
public T GetValue<T>(string key) =>
_entries.GetValue<T>(key);

/// <summary>
/// Returns an IEnumerable of all parameters
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="key"></param>
public IEnumerable<T> GetValues<T>(string key) =>
_entries.GetValues<T>(key);

/// <summary>
/// Checks to see if the parameter collection contains the value
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="key"></param>
/// <param name="value">Value of the returned parameter if it exists</param>
public bool TryGetValue<T>(string key, out T value) =>
_entries.TryGetValue(key, out value);

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

/// <summary>
/// Converts parameter collection to a parameter string
/// </summary>
/// <returns></returns>
public override string ToString()
{
var queryBuilder = new StringBuilder();
Expand Down Expand Up @@ -129,6 +185,10 @@ public override string ToString()
return queryBuilder.ToString();
}

/// <summary>
/// Adds a collection of parameters to the local parameter list
/// </summary>
/// <param name="parameters"></param>
[EditorBrowsable(EditorBrowsableState.Never)]
public void FromParameters(IEnumerable<KeyValuePair<string, object>> parameters) =>
_entries.AddRange(parameters);
Expand Down
25 changes: 24 additions & 1 deletion src/Prism.Core/Modularity/IModuleInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,36 @@

namespace Prism.Modularity
{
public interface IModuleInfo : IModuleCatalogItem
/// <summary>
/// Set of properties for each Module
/// </summary>
public interface IModuleInfo : IModuleCatalogItem
{
/// <summary>
/// The modules this instance depends on.
/// </summary>
Collection<string> DependsOn { get; set; }
/// <summary>
/// When Prism should Initialize the module
/// <see cref="InitializationMode"/>
/// </summary>
InitializationMode InitializationMode { get; set; }
/// <summary>
/// The name of the module
/// </summary>
string ModuleName { get; set; }
/// <summary>
/// The module's type
/// </summary>
string ModuleType { get; set; }
/// <summary>
/// A string ref for the module for registration/resolution
/// </summary>
string Ref { get; set; }
/// <summary>
/// An enum that lists the modules state
/// <see cref="ModuleState"/>
/// </summary>
ModuleState State { get; set; }
}
}
10 changes: 10 additions & 0 deletions src/Prism.Core/Modularity/IModuleInfoGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,20 @@
namespace Prism.Modularity
{
// IList must be supported in Silverlight 2 to be able to add items from XAML
/// <summary>
/// A collection of <see cref="ModuleInfo"/> for the Modules used by the application
/// </summary>
public interface IModuleInfoGroup : IModuleCatalogItem, IList<IModuleInfo>, IList
{
/// <summary>
/// When Prism should Initialize the module
/// <see cref="InitializationMode"/>
/// </summary>
InitializationMode InitializationMode { get; set; }

/// <summary>
/// A string ref for the module for registration/resolution
/// </summary>
string Ref { get; set; }
}
}
1 change: 1 addition & 0 deletions src/Wpf/Prism.DryIoc.Wpf/Legacy/DryIocExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public static class DryIocExtensions
/// Registers an object for navigation.
/// </summary>
/// <typeparam name="T">The Type of the object to register</typeparam>
/// <param name="container">The container instance</param>
/// <param name="name">The unique name to register with the object</param>
public static void RegisterTypeForNavigation<T>(this IContainer container, string name = null)
{
Expand Down

0 comments on commit 2eb175e

Please sign in to comment.