1
1
//
2
2
// PureMVC C# Multicore
3
3
//
4
- // Copyright(c) 2017 Saad Shams <[email protected] >
4
+ // Copyright(c) 2020 Saad Shams <[email protected] >
5
5
// Your reuse is governed by the Creative Commons Attribution 3.0 License
6
6
//
7
7
@@ -93,11 +93,11 @@ protected virtual void InitializeController()
93
93
/// <c>Controller</c> Multiton Factory method.
94
94
/// </summary>
95
95
/// <param name="key">Key of controller</param>
96
- /// <param name="func ">the <c>FuncDelegate</c> of the <c>IController</c></param>
96
+ /// <param name="factory ">the <c>FuncDelegate</c> of the <c>IController</c></param>
97
97
/// <returns>the Multiton instance of <c>Controller</c></returns>
98
- public static IController GetInstance ( string key , Func < string , IController > func )
98
+ public static IController GetInstance ( string key , Func < string , IController > factory )
99
99
{
100
- return InstanceMap . GetOrAdd ( key , new Lazy < IController > ( ( ) => func ( key ) ) ) . Value ;
100
+ return InstanceMap . GetOrAdd ( key , new Lazy < IController > ( factory ( key ) ) ) . Value ;
101
101
}
102
102
103
103
/// <summary>
@@ -107,9 +107,9 @@ public static IController GetInstance(string key, Func<string, IController> func
107
107
/// <param name="notification">note an <c>INotification</c></param>
108
108
public virtual void ExecuteCommand ( INotification notification )
109
109
{
110
- if ( commandMap . TryGetValue ( notification . Name , out var commandFunc ) )
110
+ if ( commandMap . TryGetValue ( notification . Name , out var factory ) )
111
111
{
112
- var commandInstance = commandFunc ( ) ;
112
+ var commandInstance = factory ( ) ;
113
113
commandInstance . InitializeNotifier ( multitonKey ) ;
114
114
commandInstance . Execute ( notification ) ;
115
115
}
@@ -131,14 +131,14 @@ public virtual void ExecuteCommand(INotification notification)
131
131
/// </para>
132
132
/// </remarks>
133
133
/// <param name="notificationName">the name of the <c>INotification</c></param>
134
- /// <param name="commandFunc ">the <c>Func Delegate</c> of the <c>ICommand</c></param>
135
- public virtual void RegisterCommand ( string notificationName , Func < ICommand > commandFunc )
134
+ /// <param name="factory ">the <c>Func Delegate</c> of the <c>ICommand</c></param>
135
+ public virtual void RegisterCommand ( string notificationName , Func < ICommand > factory )
136
136
{
137
137
if ( commandMap . TryGetValue ( notificationName , out _ ) == false )
138
138
{
139
139
view . RegisterObserver ( notificationName , new Observer ( ExecuteCommand , this ) ) ;
140
140
}
141
- commandMap [ notificationName ] = commandFunc ;
141
+ commandMap [ notificationName ] = factory ;
142
142
}
143
143
144
144
/// <summary>
0 commit comments