11//
22// PureMVC C# Multicore
33//
4- // Copyright(c) 2017 Saad Shams <saad.shams@puremvc.org>
4+ // Copyright(c) 2020 Saad Shams <saad.shams@puremvc.org>
55// Your reuse is governed by the Creative Commons Attribution 3.0 License
66//
77
@@ -93,11 +93,11 @@ protected virtual void InitializeController()
9393 /// <c>Controller</c> Multiton Factory method.
9494 /// </summary>
9595 /// <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>
9797 /// <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 )
9999 {
100- return InstanceMap . GetOrAdd ( key , new Lazy < IController > ( ( ) => func ( key ) ) ) . Value ;
100+ return InstanceMap . GetOrAdd ( key , new Lazy < IController > ( factory ( key ) ) ) . Value ;
101101 }
102102
103103 /// <summary>
@@ -107,9 +107,9 @@ public static IController GetInstance(string key, Func<string, IController> func
107107 /// <param name="notification">note an <c>INotification</c></param>
108108 public virtual void ExecuteCommand ( INotification notification )
109109 {
110- if ( commandMap . TryGetValue ( notification . Name , out var commandFunc ) )
110+ if ( commandMap . TryGetValue ( notification . Name , out var factory ) )
111111 {
112- var commandInstance = commandFunc ( ) ;
112+ var commandInstance = factory ( ) ;
113113 commandInstance . InitializeNotifier ( multitonKey ) ;
114114 commandInstance . Execute ( notification ) ;
115115 }
@@ -131,14 +131,14 @@ public virtual void ExecuteCommand(INotification notification)
131131 /// </para>
132132 /// </remarks>
133133 /// <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 )
136136 {
137137 if ( commandMap . TryGetValue ( notificationName , out _ ) == false )
138138 {
139139 view . RegisterObserver ( notificationName , new Observer ( ExecuteCommand , this ) ) ;
140140 }
141- commandMap [ notificationName ] = commandFunc ;
141+ commandMap [ notificationName ] = factory ;
142142 }
143143
144144 /// <summary>
0 commit comments