Skip to content

RobertGiesecke/Visualize

 
 

Repository files navigation

This is an add-in for Fody

Visualize Icon - An eye

Adds debugger attributes to help visualize objects.

Nuget

Nuget package http://nuget.org/packages/Visualize.Fody

To Install from the Nuget Package Manager Console

PM> Install-Package Visualize.Fody

Your Code

public class Example1
{
    public string Name { get; set; }
    public int Number { get; set; }
}

public class Example2 : IEnumerable<int>
{
    public IEnumerator<int> GetEnumerator()
    {
        return Enumerable.Range(0, 10).GetEnumerator();
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
        return GetEnumerator();
    }
}

What gets compiled

[DebuggerDisplay("Name = {Name} | Number = {Number}")]
public class Example1
{
    public string Name { get; set; }
    public int Number { get; set; }
}

[DebuggerTypeProxy(typeof(<Example2>Proxy))]
public class Example2 : IEnumerable<int>
{
    private sealed class <Example2>Proxy
    {
        private readonly Example2 original;

        public <Example2>Proxy(Example2 original)
        {
            this.original = original;
        }

        public int[] Items
        {
            get { return new List<int>(original).ToArray(); }
        }
    }

    public IEnumerator<int> GetEnumerator()
    {
        return Enumerable.Range(0, 10).GetEnumerator();
    }

    IEnumerator IEnumerable.GetEnumerator()
    {
        return GetEnumerator();
    }
}

Links

Contributors

Icon

Eye designed by Nicolas Ramallo from The Noun Project

About

Adds debugger attributes to help visualize objects.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 88.6%
  • PowerShell 11.4%