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 }