private bool CheckModuleDependencyConsistency(StartModuleBase module)
        {
            var tree = new Dictionary <Type, Type>();

            BuildModuleDependencyTree(module.GetType(), tree);
            return(!tree.ContainsKey(module.GetType()));
        }
        private IEnumerable <Task> BuildModuleDependencyTaskWaitList(StartModuleBase module, IEnumerable <StartModuleBase> regiteredModules)
        {
            var depList = module.GetType().GetCustomAttributes(typeof(ModuleDependencyAttribute), false)
                          .Cast <ModuleDependencyAttribute>()
                          .Select(attr => attr.DependencyType)
                          .Where(t => t != null);

            return(regiteredModules.Where(m => depList.Contains(m.GetType())).Select(m => m.CompletionSource.Task));
        }