User: xtoff
Date: 2009/12/20 07:10 AM

Modified:
 /InversionOfControl/trunk/src/Castle.Windsor.Tests/Adapters/ComponentModel/
  ContainerAdapterTestCase.cs
 /InversionOfControl/trunk/src/Castle.Windsor/Adapters/ComponentModel/
  ContainerAdapter.cs, ContainerAdapterSite.cs, ContainerWrapper.cs, 
IContainerAdapter.cs, IContainerAdapterSite.cs

Log:
 excluded entire Castle.Windsor.Adapters.ComponentModel namespace for 
Silverlight

File Changes:

Directory: /InversionOfControl/trunk/src/Castle.Windsor/Adapters/ComponentModel/
================================================================================

File [modified]: ContainerAdapter.cs
Delta lines: +2 -0
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor/Adapters/ComponentModel/ContainerAdapterSite.cs
 2009-12-20 13:01:22 UTC (rev 6502)
+++ 
InversionOfControl/trunk/src/Castle.Windsor/Adapters/ComponentModel/ContainerAdapterSite.cs
 2009-12-20 14:10:48 UTC (rev 6503)
@@ -14,6 +14,7 @@
 
 namespace Castle.Windsor.Adapters.ComponentModel
 {
+#if (!SILVERLIGHT)
        using System;
        using System.ComponentModel;
        
@@ -84,4 +85,5 @@
 
                #endregion
        }
+#endif

File [modified]: ContainerAdapterSite.cs
Delta lines: +3 -47
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor/Adapters/ComponentModel/ContainerWrapper.cs
     2009-12-20 13:01:22 UTC (rev 6502)
+++ 
InversionOfControl/trunk/src/Castle.Windsor/Adapters/ComponentModel/ContainerWrapper.cs
     2009-12-20 14:10:48 UTC (rev 6503)
@@ -14,12 +14,11 @@
 
 namespace Castle.Windsor.Adapters.ComponentModel
 {
+#if (!SILVERLIGHT)
        using System;
        using System.Collections.Generic;
        using System.ComponentModel;
-#if (!SILVERLIGHT)
        using System.ComponentModel.Design;
-#endif
        using Castle.Core;
        using Castle.Core.Internal;
        using Castle.MicroKernel;
@@ -82,9 +81,7 @@
                /// <summary>
                /// Gets or sets the <see cref="ISite"/> associated with the 
<see cref="IComponent"/>.
                /// </summary>
-#if (!SILVERLIGHT)
                
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden), 
Browsable(false)]
-#endif
                public virtual ISite Site
                {
                        get { return site; }
@@ -95,9 +92,7 @@
                /// Event that notifies the disposal of the <see 
cref="IComponent"/>.
                /// </summary>
                [EditorBrowsable(EditorBrowsableState.Advanced)]
-#if (!SILVERLIGHT)
                [Browsable(false)]
-#endif
                public event EventHandler Disposed;
 
                #endregion
@@ -111,7 +106,6 @@
                {
                        get
                        {
-#if (!SILVERLIGHT)
                                using(@lock.ForReading())
                                {
                                        IComponent[] components = new 
IComponent[sites.Count];
@@ -123,9 +117,6 @@
 
                                        return new 
ComponentCollection(components);
                                }
-#else
-                               return new ComponentCollection();
-#endif
                        }
                }
 
@@ -237,9 +228,7 @@
 
                        // Check for instrinsic services.
                        if (serviceType == typeof(IWindsorContainer) ||
-#if (!SILVERLIGHT)
                                serviceType == typeof(IServiceContainer) ||
-#endif
                                serviceType == typeof(IContainer))
                        {
                                service = this;
@@ -285,7 +274,6 @@
                {
                        AddService(serviceType, serviceInstance, false);
                }
-#if (!SILVERLIGHT)
                /// <summary>
                /// Adds the specified service to the service container.
                /// </summary>
@@ -295,8 +283,6 @@
                {
                        AddService(serviceType, callback, false);
                }
-#endif
-#if (!SILVERLIGHT)
                /// <summary>
                /// Adds the specified service to the service container, and 
optionally
                /// promotes the service to any parent service containers.
@@ -305,18 +291,7 @@
                /// <param name="serviceInstance">The instance of the service 
to add.</param>
                /// <param name="promote">true to promote this request to any 
parent service containers.</param>
                public virtual void AddService(Type serviceType, object 
serviceInstance, bool promote)
-#else
-               /// <summary>
-               /// Adds the specified service to the service container, and 
optionally
-               /// promotes the service to any parent service containers.
-               /// </summary>
-               /// <param name="serviceType">The type of service to 
add.</param>
-               /// <param name="serviceInstance">The instance of the service 
to add.</param>
-               /// <param name="promote">ignored.</param>
-               public virtual void AddService(Type serviceType, object 
serviceInstance, bool promote)
-#endif
                {
-#if (!SILVERLIGHT)
                        if (serviceInstance is ServiceCreatorCallback)
                        {
                                AddService(serviceType, 
(ServiceCreatorCallback) serviceInstance, promote);
@@ -333,7 +308,6 @@
                                        return;
                                }
                        }
-#endif
 
                        if (serviceType == null)
                        {
@@ -363,7 +337,6 @@
                        Kernel.AddComponentInstance(serviceName, serviceType, 
serviceInstance);
                }
                
-#if (!SILVERLIGHT)
                /// <summary>
                /// Adds the specified service to the service container, and 
optionally 
                /// promotes the service to parent service containers.
@@ -410,7 +383,6 @@
                        model.CustomComponentActivator = 
typeof(ServiceCreatorCallbackActivator);
                        Kernel.AddCustomComponent(model);
                }
-#endif
 
                /// <summary>
                /// Removes the specified service type from the service 
container.
@@ -421,7 +393,6 @@
                        RemoveService(serviceType, false);
                }
 
-#if (!SILVERLIGHT)
                /// <summary>
                /// Removes the specified service type from the service 
container, 
                /// and optionally promotes the service to parent service 
containers.
@@ -429,17 +400,7 @@
                /// <param name="serviceType">The type of service to 
remove.</param>
                /// <param name="promote">true to promote this request to any 
parent service containers.</param>
                public virtual void RemoveService(Type serviceType, bool 
promote)
-#else
-               /// <summary>
-               /// Removes the specified service type from the service 
container, 
-               /// and optionally promotes the service to parent service 
containers.
-               /// </summary>
-               /// <param name="serviceType">The type of service to 
remove.</param>
-               /// <param name="promote">ignored.</param>
-               public virtual void RemoveService(Type serviceType, bool 
promote)
-#endif
                {
-#if (!SILVERLIGHT)
                        if (promote)
                        {
                                IServiceContainer parentServices = 
ParentServices;
@@ -450,7 +411,6 @@
                                        return;
                                }
                        }
-#endif
 
                        if (serviceType == null)
                        {
@@ -478,9 +438,7 @@
                private bool IsIntrinsicService(Type serviceType)
                {
                        return serviceType == typeof(IWindsorContainer) ||
-#if (!SILVERLIGHT)
                                serviceType == typeof(IServiceContainer) ||
-#endif
                                serviceType == typeof(IContainer) ||
                                serviceType == typeof(IKernel);
                }
@@ -503,9 +461,7 @@
                /// <summary>
                /// Gets the adapted <see cref="IWindsorContainer"/>
                /// </summary>
-#if (!SILVERLIGHT)
                [Browsable(false), 
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
-#endif
                public IWindsorContainer Container
                {
                        get { return container; }
@@ -606,7 +562,7 @@
                {
                        get { return container.Kernel; }
                }
-#if (!SILVERLIGHT)
+
                private IServiceContainer ParentServices
                {
                        get
@@ -626,7 +582,6 @@
                                return parentServices;
                        }
                }
-#endif
 
                private void RegisterAdapterWithKernel()
                {
@@ -643,4 +598,5 @@
 
                #endregion
        }
+#endif

File [modified]: ContainerWrapper.cs
Delta lines: +3 -18
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor/Adapters/ComponentModel/IContainerAdapter.cs
    2009-12-20 13:01:22 UTC (rev 6502)
+++ 
InversionOfControl/trunk/src/Castle.Windsor/Adapters/ComponentModel/IContainerAdapter.cs
    2009-12-20 14:10:48 UTC (rev 6503)
@@ -14,8 +14,8 @@
 
 namespace Castle.Windsor.Adapters.ComponentModel
 {
-       using System.ComponentModel;
 #if (!SILVERLIGHT)
+       using System.ComponentModel;
        using System.ComponentModel.Design;
 
        /// <summary>
@@ -25,23 +25,8 @@
        /// <seealso cref="IComponent"/>
        /// <seealso cref="IContainer"/>
        /// <seealso cref="IServiceContainer"/>
-       public interface IContainerAdapter : IComponent, IContainer,
-               IServiceContainer,
-#else
-       using System;
-
-       /// <summary>
-       /// Integrates the <see cref="WindsorContainer"/> to the 
System.ComponentModel
-       /// and System.ComponentMode.Design infrastructure.
-       /// </summary>
-       /// <seealso cref="IComponent"/>
-       /// <seealso cref="IContainer"/>
-       public interface IContainerAdapter : IComponent, IContainer,
-#endif
- IContainerAccessor
+       public interface IContainerAdapter : IComponent, 
IContainer,IServiceContainer,IContainerAccessor
        {
-#if (SILVERLIGHT)
-               object GetService(Type serviceType);
-#endif
        }
+#endif

File [modified]: IContainerAdapter.cs
Delta lines: +2 -1
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor/Adapters/ComponentModel/IContainerAdapterSite.cs
        2009-12-20 13:01:22 UTC (rev 6502)
+++ 
InversionOfControl/trunk/src/Castle.Windsor/Adapters/ComponentModel/IContainerAdapterSite.cs
        2009-12-20 14:10:48 UTC (rev 6503)
@@ -14,11 +14,12 @@
 
 namespace Castle.Windsor.Adapters.ComponentModel
 {
-       using System;
+#if (!SILVERLIGHT)
        using System.ComponentModel;
 
        public interface IContainerAdapterSite : ISite
        {
                string EffectiveName { get; }
        }
+#endif

File [modified]: IContainerAdapterSite.cs
Delta lines: +5 -28
===================================================================

--- 
InversionOfControl/trunk/src/Castle.Windsor.Tests/Adapters/ComponentModel/ContainerAdapterTestCase.cs
       2009-12-20 13:01:22 UTC (rev 6502)
+++ 
InversionOfControl/trunk/src/Castle.Windsor.Tests/Adapters/ComponentModel/ContainerAdapterTestCase.cs
       2009-12-20 14:10:48 UTC (rev 6503)
@@ -14,15 +14,15 @@
 
 namespace Castle.Windsor.Tests.Adapters.ComponentModel
 {
+#if (!SILVERLIGHT)
        using System;
        using System.ComponentModel;
-#if (!SILVERLIGHT)
        using System.ComponentModel.Design;
-#endif
 
        using Castle.MicroKernel;
        using Castle.Windsor.Adapters.ComponentModel;
        using Castle.Windsor.Tests.Components;
+
        using NUnit.Framework;
 
        [TestFixture]
@@ -50,9 +50,7 @@
                public void GetIntrinsicServices()
                {
                        
Assert.IsNotNull(container.GetService(typeof(IContainer)));
-#if (!SILVERLIGHT)
                        
Assert.IsNotNull(container.GetService(typeof(IServiceContainer)));
-#endif
                        
Assert.IsNotNull(container.GetService(typeof(IWindsorContainer)));
                        Assert.IsNotNull(container.GetService(typeof(IKernel)));
                }
@@ -224,7 +222,6 @@
                        container.AddService(typeof(ICalcService), new 
CalculatorService());
                }
 
-#if (!SILVERLIGHT)
                [Test]
                public void AddServiceCreatorCallback()
                {
@@ -263,7 +260,7 @@
                        Assert.IsNull(child.GetService(typeof(ICalcService)));
                        
Assert.AreSame(container.GetService(typeof(ICalcService)), service);
                }
-#endif
+
                [Test]
                public void RemoveServiceInstance()
                {
@@ -335,36 +332,16 @@
                        Assert.IsTrue(disposed);
                }
                
-#if (!SILVERLIGHT)
                private object CreateCalculatorService(IServiceContainer 
container, Type serviceType)
                {
                        ++calledCount;
                        return new CalculatorService();
                }
-#endif
+
                private void Container_Disposed(object source, EventArgs args)
                {
                        disposed = true;
                }
        }
-
-       public class Component:IComponent
-       {
-               public void Dispose()
-               {
-                       Dispose(true);
-               }
-
-               public virtual ISite Site
-               {
-                       get; set;
-               }
-
-               public event EventHandler Disposed = delegate { };
-
-               protected virtual void Dispose(bool disposing)
-               {
-                       Disposed(this, EventArgs.Empty);
-               }
-       }
+#endif
 }

Directory: 
/InversionOfControl/trunk/src/Castle.Windsor.Tests/Adapters/ComponentModel/
======================================================================================

File [modified]: ContainerAdapterTestCase.cs
Delta lines: +0 -0
===================================================================

--

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.


Reply via email to