root/src/BRAINSFramework/Behaviors/BehaviorList.cs

User picture

Author: conkerjo

Revision: 30 («Previous)


File Size: 670 Bytes

(July 01, 2009 23:02 UTC) Almost 3 years ago


  

 
Show/hide line numbers

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Brains.Framework.Behaviors
{
    /// <summary>
    /// Behavior Collection class
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class BehaviorList<T>:List<T> where T : IBehavior
    {
        IBehavior _owner;
        public IBehavior Owner
        {
            get { return _owner; }
            set
            {
                _owner = value;
                foreach (var item in this)
                {
                    item.SetOwner(_owner.Owner);
                }
            }
        }
      
    }
}