Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom display strings #48

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pezipink
Copy link

@pezipink pezipink commented Aug 2, 2015

This PR attempts to add two related features;

  1. eye.SetDisplayString(type, displayString) where the display string is similar to DebuggerDisplayAttribute. That is, the string may contain {PropertyNames} which will be replaced with the .ToString() version of the property in question.

  2. eye.SetFormatter f accepts a callback function that allows the user to generate display strings directly for each instance within the context of their program.

Notes:

  • I just realised there is a regex helper, maybe my regex could should be changed to use it, though it is very simple.
  • No tests yet. I have tested it pretty well and it is quite defensive.
  • I should really update the docs!

Future enhancements

  • Display strings only work with properties, would be cool to include members and methods as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant