Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- publiv void RefreshValues()
- {
- var stack = new StackTrace(1);
- var frames = stack.GetFrames();
- var m = MethodBase.GetCurrentMethod().Name;
- if (frames.Any(f => f.GetMethod().Name == m))
- return;
- // actual code that sets values which in turn might (or might not) call this method again
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement