private void AddMethodName()
{
var stackTrace = new StackTrace();
StackFrame callerFrame = stackTrace.GetFrame(1);
MethodBase callingMethod = callerFrame.GetMethod();
if (callingMethod.DeclaringType != typeof(RecordingProvider))
{
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "Unexpected calling method '{0}.{1}'.", callingMethod.DeclaringType, callingMethod.Name));
}
string methodName = callingMethod.Name;
Debug.Assert(typeof(IProvider).GetMethod(methodName) != null, string.Format("IProvider has not '{0}' method.", methodName));
AddMethodName(methodName);
}