Home > Development > Castle Windsor Arrays In XML Configuration

Castle Windsor Arrays In XML Configuration

Just a quick follow up on the array setup with castle windsor in code. Here is how you do it in XML. No the use of array and item around each item in the array. A point to not if you have complex user defined type that are not strings and integers etc you need to define a type converter to set these up. This goes for normal parameters as well. I’ll cover it in another article. Heres the code and XML.

using Castle.Windsor;
using Castle.Windsor.Configuration.Interpreters;

namespace CastleWindsorDemo

    public interface INotifier
        void Notify();

    public class Notifier : INotifier
        private readonly string[] to;
        private readonly string from;

        public Notifier(string from, string[] to)
            this.to = to;
            this.from = from;

        public void Notify()
            // Put code to send to people wishing to be notified here

    class Program
        static void Main()
            WindsorContainer container = new WindsorContainer(new XmlInterpreter());
            INotifier notifier = container.Resolve<INotifier>();


<?xml version="1.0" encoding="utf-8" ?>
        type="Castle.Windsor.Configuration.AppDomain.CastleSectionHandler, Castle.Windsor" />
      <component id="notifier" 


Categories: Development Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: