コード例 #1
0
        public override bool Equals(object obj)
        {
            CreatedComponent rhs = obj as CreatedComponent;

            if (rhs != null)
            {
                return(TypeName == rhs.TypeName && Name == rhs.Name);
            }
            return(base.Equals(obj));
        }
コード例 #2
0
        public IComponent CreateComponent(Type componentClass, string name)
        {
            object instance = componentClass.Assembly.CreateInstance(componentClass.FullName);

            if (rootComponent == null)
            {
                rootComponent = instance as IComponent;
            }

            CreatedComponent c = new CreatedComponent(componentClass.FullName, name, (IComponent)instance);

            createdComponents.Add(c);

            return((IComponent)instance);
        }