예제 #1
0
        public void SignalGlobalMgrReady(Type type)
        {
            GlobalMgrInfo globalMgrInfo = GetGlobalMgrInfo(type);

            if (globalMgrInfo == null)
            {
                throw new InitializationException(
                          "Invalid Signal - {0} signaled to be ready but did not register as a GlobalMgr.", (object)type.FullName);
            }
            if (globalMgrInfo.IsInitialized)
            {
                return;
            }
            globalMgrInfo.IsInitialized = true;
            foreach (DependentInitializationStep dependency in globalMgrInfo.Dependencies)
            {
                TryResolve(dependency);
            }
        }
예제 #2
0
        private void InitDependencies(IEnumerable <DependentInitializationStep> dependentSteps)
        {
            foreach (DependentInitializationStep dependentStep in dependentSteps)
            {
                foreach (InitializationDependency initializationDependency in dependentStep.Dependency)
                {
                    GlobalMgrInfo globalMgrInfo = GetGlobalMgrInfo(initializationDependency.DependentType);
                    if (globalMgrInfo == null)
                    {
                        throw new InitializationException(
                                  "Invalid Dependency - {0} is dependent on {1} which is not a GlobalMgr.",
                                  (object)dependentStep.Step.InitMethod.GetFullMemberName(),
                                  (object)initializationDependency.DependentType.FullName);
                    }
                    globalMgrInfo.Dependencies.Add(dependentStep);
                    initializationDependency.DependentMgr = globalMgrInfo;
                }

                TryResolve(dependentStep);
            }
        }