Ejemplo n.º 1
0
        public IEnumerable <IClass> GetAttributedClasses <TClass>(INamespace ns, DependencyStore dependencyStore)
        {
            var trie = myCache.GetTrie <TClass>();

            if (trie == null)
            {
                yield break;
            }

            var names = ns.QualifiedName.Split('.');

            uint dependency = 0;

            foreach (var name in names)
            {
                // store dependency on every owner namespace
                dependency += (uint)name.GetHashCode();
                dependencyStore.AddDependency(new Dependency(dependency));
            }

            foreach (var node in trie.Explore(names))
            {
                foreach (var annotation in node.Annotations)
                {
                    var annotationClass = myCache.FindClass(annotation);
                    if (annotationClass != null)
                    {
                        foreach (var @class in EnumerableMarkClasses(annotationClass, true))
                        {
                            yield return(@class);
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void ConfigureServices(IServiceCollection services)
        {
            var bootstrappers = new List <IModuleBootstrapper> {
                new OPS.BL.Bootstrapper(),
                new OPS.DAL.Bootstrapper()
            };
            var dependencyStore = new DependencyStore(services);

            foreach (var bootstrapper in bootstrappers)
            {
                foreach (var module in bootstrapper.GetModules())
                {
                    module.Bootstrap(dependencyStore);
                }
            }
            services.AddMvc();
        }
 public DependencyAwareService(IServiceLocator locator, bool checkDependencies)
 {
     this._dependencystore = new DependencyStore(locator);
 }
Ejemplo n.º 4
0
 public MarksService(AttributedTypesCache cache, DependencyStore dependencyStore, ISettingsStore settingsStore, Lifetime lifetime)
 {
     myCache           = cache;
     myDependencyStore = dependencyStore;
     Enabled           = settingsStore.BindToContextLive(lifetime, ContextRange.ApplicationWide).GetValueProperty <bool>(lifetime, settingsStore.Schema.GetScalarEntry((ZoneSettings settings) => settings.CheckZones), null);
 }