Esempio n. 1
0
        public void Load(string folder, string?exclusionFilter = @"Migrations\\\d{15}")
        {
            _solutionFolder = folder;

            var sourceFilesProvider = new SourceFilesProvider(folder, exclusionFilter);

            var _ = ResourceManager.ReloadAsync(folder, sourceFilesProvider.EnumerateSourceFiles(), null).Result;
        }
Esempio n. 2
0
        public Host()
        {
            var assembly = GetType().Assembly;
            var folder   = Path.GetDirectoryName(assembly.Location);

            Contract.Assume(!string.IsNullOrEmpty(folder));

            _compositionHost.AddCatalog(new DirectoryCatalog(folder, "*.dll"));

            _sourceFilesProvider           = _compositionHost.GetExportedValue <SourceFilesProvider>();
            _resourceManager               = _compositionHost.GetExportedValue <ResourceManager>();
            _resourceManager.BeginEditing += ResourceManager_BeginEditing;
        }
Esempio n. 3
0
        public Host()
        {
            var assembly = GetType().Assembly;
            var folder   = Path.GetDirectoryName(assembly.Location);

            // ReSharper disable once AssignNullToNotNullAttribute
            _compositionHost.AddCatalog(new DirectoryCatalog(folder, "*.dll"));

            _sourceFilesProvider          = _compositionHost.GetExportedValue <SourceFilesProvider>();
            ResourceManager               = _compositionHost.GetExportedValue <ResourceManager>();
            ResourceManager.BeginEditing += ResourceManager_BeginEditing;

            Configuration = _compositionHost.GetExportedValue <Configuration>();
        }
Esempio n. 4
0
        public Host()
        {
            var assembly = GetType().Assembly;

            _kernel.BindExports(assembly,
                                typeof(Infrastructure.Properties.AssemblyKey).Assembly,
                                typeof(Model.Properties.AssemblyKey).Assembly);

            IExportProvider exportProvider = new ExportProvider(_kernel);

            _sourceFilesProvider = exportProvider.GetExportedValue <SourceFilesProvider>();

            ResourceManager = exportProvider.GetExportedValue <ResourceManager>();
            ResourceManager.BeginEditing += ResourceManager_BeginEditing;

            Configuration = exportProvider.GetExportedValue <Configuration>();
        }
Esempio n. 5
0
        public Host()
        {
            var assembly = GetType().Assembly;
            var folder   = Path.GetDirectoryName(assembly.Location);

            _compositionCatalog   = new AggregateCatalog();
            _compositionContainer = new CompositionContainer(_compositionCatalog, true);
            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(assembly));
            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ResXManager.Infrastructure.ITracer).Assembly));
            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ResXManager.Model.GlobalExtensions).Assembly));

            _sourceFilesProvider          = _compositionContainer.GetExportedValue <SourceFilesProvider>();
            ResourceManager               = _compositionContainer.GetExportedValue <ResourceManager>();
            ResourceManager.BeginEditing += ResourceManager_BeginEditing;

            Configuration = _compositionContainer.GetExportedValue <Configuration>();
        }
Esempio n. 6
0
        public Host()
        {
            var assembly = GetType().Assembly;

            _compositionCatalog   = new AggregateCatalog();
            _compositionContainer = new CompositionContainer(_compositionCatalog, true);
            // ReSharper disable RedundantNameQualifier
            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(assembly));
            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ResXManager.Infrastructure.ITracer).Assembly));
            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(typeof(ResXManager.Model.GlobalExtensions).Assembly));
            // ReSharper restore RedundantNameQualifier

            _sourceFilesProvider          = _compositionContainer.GetExportedValue <SourceFilesProvider>();
            ResourceManager               = _compositionContainer.GetExportedValue <ResourceManager>();
            ResourceManager.BeginEditing += ResourceManager_BeginEditing;

            Configuration = _compositionContainer.GetExportedValue <Configuration>();
        }
Esempio n. 7
0
        public Host()
        {
            var assembly = GetType().Assembly;
            var folder   = Path.GetDirectoryName(assembly.Location);

            _compositionCatalog   = new AggregateCatalog();
            _compositionContainer = new CompositionContainer(_compositionCatalog, true);
            //_exportProvider = new ExportProviderAdapter(_compositionContainer);
            //_compositionContainer.ComposeExportedValue(_exportProvider);

            // ReSharper disable once AssignNullToNotNullAttribute
            _compositionCatalog.Catalogs.Add(new DirectoryCatalog(folder, "*.dll"));

            _sourceFilesProvider          = _compositionContainer.GetExportedValue <SourceFilesProvider>();
            ResourceManager               = _compositionContainer.GetExportedValue <ResourceManager>();
            ResourceManager.BeginEditing += ResourceManager_BeginEditing;

            Configuration = _compositionContainer.GetExportedValue <Configuration>();
        }
Esempio n. 8
0
        public Host()
        {
            var assembly = GetType().Assembly;

            _compositionCatalog   = new AggregateCatalog();
            _compositionContainer = new CompositionContainer(_compositionCatalog, true);
#pragma warning disable CA2000 // Dispose objects before losing scope => AggregateCatalog will dispose all
            // ReSharper disable RedundantNameQualifier
            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(assembly));
            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(typeof(Infrastructure.Properties.AssemblyKey).Assembly));
            _compositionCatalog.Catalogs.Add(new AssemblyCatalog(typeof(Model.Properties.AssemblyKey).Assembly));
#pragma warning restore CA2000 // Dispose objects before losing scope
            // ReSharper restore RedundantNameQualifier

            _sourceFilesProvider          = _compositionContainer.GetExportedValue <SourceFilesProvider>();
            ResourceManager               = _compositionContainer.GetExportedValue <ResourceManager>();
            ResourceManager.BeginEditing += ResourceManager_BeginEditing;

            Configuration = _compositionContainer.GetExportedValue <Configuration>();
        }