private IPresenter InitializePresenter(object view)
{
IDictionary arguments = new Hashtable(1);
arguments.Add("view", view);
IPresenter presenter = IoC.Resolve<IPresenter>(_presenterType, arguments);
presenter.Initialize();
PresentersCache.Put(view, presenter);
return presenter;
}
public abstract class Presenter<V> : IPresenter where V : class, IView
{
private readonly V _view;
public V View
{
get { return _view; }
}
public Presenter(V view)
{
if (view == null)
throw new ArgumentNullException("view");
_view = view;
}
public void Initialize()
{
if (!_isInitialized)
{
InitializePresenter();
_isInitialized = true;
}
}
private bool _isInitialized;
public bool IsInitialized
{
get { return _isInitialized; }
}
protected virtual void InitializePresenter()
{}
}
On Tue, Apr 7, 2009 at 8:24 PM, Paul Hatcher <[email protected]> wrote:
>
> German
>
> Thanks, but I don't think it applies.
>
> The issue as I see it is that as the web app is multi-threaded I can't
> put anything into the container that I don't want all threads to see
> and I also don't want Windsor to be responsible for the creation of
> the views as they already exist.
>
> What I want is something along the lines of..
>
> container.Resolve<CustomerEditPresenter>(controller.ViewCollection)
>
> where the container knows how to ask the passed value if it has any
> dependencies that it might be interested in.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Castle Project Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---