using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Chernobyl.Collections.Generic;
using Chernobyl.Collections.Generic.Event;
using Chernobyl.Collections.Generic.Hierarchy;
using Chernobyl.Event;
namespace Chernobyl.Reflection.Template
{
///
/// An interface for dealing with objects that are part or piece of some
/// coding construct. For example, instances, variables, properties, methods,
/// arguments to a method, etc are all components.
///
public interface IComponent : INamed, ITreeEnumerable
{
///
/// The namespace or prefix of this component.
///
string Prefix { get; }
///
/// The name of this component which can be used to generate code for
/// this component.
///
string CodeName { get; }
///
/// The that is the parent to this
/// . This will be
/// added to the parent 's
/// list. If this
/// is already a child to another then it will
/// be removed from that 's
/// list. Setting null on this property
/// will cause this to be removed from it's
/// parent, if necessary.
///
IComponent Parent { get; set; }
///
/// Sub-components of this which may include
/// members, arguments, attributes, or other data depending on the goals
/// of the implementing type.
///
IEventCollection ComponentChildren { get; }
///
/// The that "decorates"
/// (http://en.wikipedia.org/wiki/Decorator_pattern) this
/// . The decorator is used when this
/// needs client code to refer to the
/// decorator rather than this such as when
/// parenting children. In the event that a decorator doesn't exist,
/// this property is set to null.
///
IComponent Decorator { get; set; }
}
///
/// An implementation of to make the creation of
/// new types easier.
///
public abstract class Component : IComponent
{
///
/// Initializes a new instance of the class.
///
/// The services instance to use when injecting
/// or receiving dependencies from created instances.
/// The namespace or prefix of this component.
/// The name of this component which can be used to generate code for
/// this component.
protected Component(IEventCollection