User: xtoff
Date: 2009/12/20 04:22 AM
Modified:
/InversionOfControl/trunk/lib/silverlight-3.0/
Castle.Core.dll, Castle.Core.xml, Castle.DynamicProxy2.dll
/InversionOfControl/trunk/src/Castle.MicroKernel/Handlers/
AbstractHandler.cs
Log:
- excluded per web request lifestyle in Silverlight
File Changes:
Directory: /InversionOfControl/trunk/src/Castle.MicroKernel/Handlers/
=====================================================================
File [modified]: AbstractHandler.cs
Delta lines: +0 -0
===================================================================
Directory: /InversionOfControl/trunk/lib/silverlight-3.0/
=========================================================
File [modified]: Castle.Core.dll
Delta lines: None
None
File [modified]: Castle.Core.xml
Delta lines: +34 -35
===================================================================
--- InversionOfControl/trunk/src/Castle.MicroKernel/Handlers/AbstractHandler.cs
2009-12-20 11:06:45 UTC (rev 6496)
+++ InversionOfControl/trunk/src/Castle.MicroKernel/Handlers/AbstractHandler.cs
2009-12-20 11:22:16 UTC (rev 6497)
@@ -375,48 +375,47 @@
LifestyleType type = ComponentModel.LifestyleType;
- if (type == LifestyleType.Undefined || type ==
LifestyleType.Singleton)
+ switch (type)
{
- manager = new SingletonLifestyleManager();
- }
- else if (type == LifestyleType.Thread)
- {
-#if (SILVERLIGHT)
- manager = new
PerThreadThreadStaticLifestyleManager();
+ case LifestyleType.Thread:
+#if (!SILVERLIGHT)
+ manager = new
PerThreadLifestyleManager();
#else
- manager = new PerThreadLifestyleManager();
+ manager = new
PerThreadThreadStaticLifestyleManager();
#endif
- }
- else if (type == LifestyleType.Transient)
- {
- manager = new TransientLifestyleManager();
- }
+ break;
+ case LifestyleType.Transient:
+ manager = new
TransientLifestyleManager();
+ break;
#if (!SILVERLIGHT)
- else if (type == LifestyleType.PerWebRequest)
- {
- manager = new PerWebRequestLifestyleManager();
- }
+ case LifestyleType.PerWebRequest:
+ manager = new
PerWebRequestLifestyleManager();
+ break;
#endif
- else if (type == LifestyleType.Custom)
- {
- manager = (ILifestyleManager)
-
Activator.CreateInstance(ComponentModel.CustomLifestyle);
- }
- else if (type == LifestyleType.Pooled)
- {
- int initial =
ExtendedPropertiesConstants.Pool_Default_InitialPoolSize;
- int maxSize =
ExtendedPropertiesConstants.Pool_Default_MaxPoolSize;
-
- if
(ComponentModel.ExtendedProperties.Contains(ExtendedPropertiesConstants.Pool_InitialPoolSize))
+ case LifestyleType.Custom:
+ manager =
(ILifestyleManager)Activator.CreateInstance(ComponentModel.CustomLifestyle);
+ break;
+ case LifestyleType.Pooled:
{
- initial =
(int)ComponentModel.ExtendedProperties[ExtendedPropertiesConstants.Pool_InitialPoolSize];
- }
- if
(ComponentModel.ExtendedProperties.Contains(ExtendedPropertiesConstants.Pool_MaxPoolSize))
- {
- maxSize =
(int)ComponentModel.ExtendedProperties[ExtendedPropertiesConstants.Pool_MaxPoolSize];
- }
+ int initial =
ExtendedPropertiesConstants.Pool_Default_InitialPoolSize;
+ int maxSize =
ExtendedPropertiesConstants.Pool_Default_MaxPoolSize;
- manager = new PoolableLifestyleManager(initial,
maxSize);
+ if
(ComponentModel.ExtendedProperties.Contains(ExtendedPropertiesConstants.Pool_InitialPoolSize))
+ {
+ initial =
(int)ComponentModel.ExtendedProperties[ExtendedPropertiesConstants.Pool_InitialPoolSize];
+ }
+ if
(ComponentModel.ExtendedProperties.Contains(ExtendedPropertiesConstants.Pool_MaxPoolSize))
+ {
+ maxSize =
(int)ComponentModel.ExtendedProperties[ExtendedPropertiesConstants.Pool_MaxPoolSize];
+ }
+
+ manager = new
PoolableLifestyleManager(initial, maxSize);
+ }
+ break;
+ default:
+ //this includes
LifestyleType.Undefined, LifestyleType.Singleton and invalid values
+ manager = new
SingletonLifestyleManager();
+ break;
}
File [modified]: Castle.DynamicProxy2.dll
Delta lines: None
None
--
You received this message because you are subscribed to the Google Groups
"Castle Project Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/castle-project-commits?hl=en.