PageRenderTime 19ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/Source/Bifrost.Mimir/ViewModelConvention.cs

#
C# | 27 lines | 23 code | 4 blank | 0 comment | 0 complexity | df91951bb3d1f6379ef31def679b0973 MD5 | raw file
 1using System;
 2using Bifrost.Execution;
 3using Bifrost.Notification;
 4
 5namespace Bifrost.Mimir
 6{
 7    public class ViewModelConvention : BaseConvention
 8    {
 9        private readonly NotifyingObjectWeaver _weaver;
10
11        public ViewModelConvention()
12        {
13            _weaver = new NotifyingObjectWeaver();
14        }
15
16        public override bool CanResolve(Type service)
17        {
18            return service.Name.Equals("ViewModel");
19        }
20
21        public override void Resolve(IContainer container, Type service)
22        {
23            var proxy = _weaver.GetProxyType(service);
24            container.Bind(service,proxy);
25        }
26    }
27}