Buenas,
yesterday I commented on the availability of Unity for .net 4.5 and also made a comment on Agent Mulder . Agent Mulder is an awesome extension for ReSharper that allows you to navigate to a specific type declarations and implementations when we are working with some dependency injection container.
How to explain it in words I’m not well today, better go to an example. Suppose that we are working with Unity and have a with the following example console application:
1: using System;
2: using System.Diagnostics;
3: using Microsoft.Practices.Unity;
4:
5: namespace ConsoleApplication1
6: {
7: class Program
8: {
9: static void Main(string[] args)
10: {
11: var container = new UnityContainer();
12: container.RegisterType<ILogger, LogDebug>();
13: var log = container.Resolve<ILogger>();
14: log.Log("sample data");
15: Console.ReadLine();
16: }
17: }
18: internal interface ILogger
19: {
20: void Log(string data);
21: }
22: class LogTrace: ILogger
23: {
24: public void Log(string data)
25: {
26: Trace.WriteLine(data);
27: }
28: }
29: class LogDebug : ILogger
30: {
31: public void Log(string data)
32: {
33: Debug.WriteLine(data);
34: }
35: }
36: }
In the Visual Studio IDE, trying to see where the LogDebug class has been used is a bit craftsmanship, having no direct references, because it is a little complicated to know where you are using. If we see the help online that we since we will see something similar to the following in the code editor
Now if you download and install Agent Mulder , this plugin from ReSharper will show us that the class LogDebug() is registering and using with Unity. We can access registration of the same line and even then accessing dynamic references of ReSharper to see where it is implemented and use the Log() function.
In a few words Agent Mulder helps us to navigate between the references that we do with a dependency injector, as Unity, CastleWindsor, etc. The official website of the product sample is mounted on CastleWindsor .
Download: http://hmemcpy.github.com/AgentMulder/
Saludos @ La Finca
El Bruno

Leave a comment