Get calling method

2009-Чер-15, Понеділок 13:24
[personal profile] finesoul

    public static class ReflectionHelper
    {
        ....

        public static StackFrame GetCallingMethod(bool getFileNames)
        {
            StackTrace st = new StackTrace(true);
            /// When it is placed in the separate class we use 2 as constant
            return st.FrameCount > 2 ? st.GetFrame(2) : null;
        }
    }

Лютий 2022

Н П В С Ч П С
  12345
6789101112
13141516171819
202122232425 26
2728     

За стиль дякую

Створено з Dreamwidth Studios
Сторінка створена 2026-Лют-13, П'ятниця 10:32