Composite.GlobalInitializerFacade.ValidateIsOnlyCalledFromGlobalInitializerFacade C# (CSharp) Метод

ValidateIsOnlyCalledFromGlobalInitializerFacade() публичный статический Метод

public static ValidateIsOnlyCalledFromGlobalInitializerFacade ( StackTrace stackTrace ) : void
stackTrace System.Diagnostics.StackTrace
Результат void
        public static void ValidateIsOnlyCalledFromGlobalInitializerFacade(StackTrace stackTrace)
        {
            MethodBase methodInfo = stackTrace.GetFrame(1).GetMethod();

            if (methodInfo.DeclaringType != typeof(GlobalInitializerFacade))
            {
                throw new SystemException(string.Format("The method {0} may only be called by the {1}", stackTrace.GetFrame(1).GetMethod(), typeof(GlobalInitializerFacade)));
            }
        }