public ContainerBuilder With(CompleteConfiguration configuration)
        {
            Configuration = configuration;

            // Common
            Container.RegisterSingleton <ISkipTypeRule, SkipTypeRule>();

            // Configuration
            Container.RegisterSingleton(configuration);
            Container.RegisterSingleton(() => configuration.Input);
            Container.RegisterSingleton(() => configuration.Translation);
            Container.RegisterSingleton(() => configuration.Output);

            // Input
            Container.RegisterSingleton <ITargetTypesLocator, TargetTypesLocator>();

            // Translation
            Container.RegisterSingleton <IDiscoveredTypeRegistrator, DiscoveredTypeRegistrator>();
            Container.RegisterSingleton <ITypeScriptExpression, TypeScriptExpression>();
            Container.RegisterSingleton <ISourceTypeMetadataFactory, SourceTypeMetadataFactory>();
            Container.RegisterSingleton <ITranslatedTypeMetadataFactory, TranslatedTypeMetadataFactory>();
            Container.RegisterSingleton <ITranslationContext, TranslationContext>();
            Container.RegisterSingleton <ITypeTranslationContextFactory, TypeTranslationContextFactory>();
            Container.RegisterSingleton <TypeTranslationChain>(); // This is the cornerstone class, this is why it's registered directly and does not implement an interface.
            Container.RegisterSingleton <ISymbolNamer, SymbolNamer>();
            Container.RegisterSingleton <ICommenter, Commenter>();

            // Output
            Container.RegisterSingleton <ITranslationResultWriterFactory, TranslationResultWriterFactory>();

            return(this);
        }
示例#2
0
        public void CreateConfiguration()
        {
            var demoConfig = new CompleteConfiguration
            {
                Input = new InputConfiguration
                {
                    Assemblies = new List <string> {
                        "a", "b"
                    },
                    IncludeTypes = new List <string> {
                        "a", "b"
                    },
                    ExcludeTypes = new List <string> {
                        "a", "b"
                    },
                    SkipTypesWithAttribute = new List <string> {
                        "a", "b"
                    },
                    SkipMembersWithAttribute = new List <string> {
                        "a", "b"
                    }
                },
                Output = new OutputConfiguration
                {
                    Location = "location",
                    Mode     = OutputMode.NamespaceHierarchyDirecory
                },
                Translation = new TranslationConfiguration
                {
                    GeneratedSymbols = new GeneratedSymbolsConfiguration
                    {
                        Prefix = "Pref",
                        Suffix = "Suff"
                    }
                }
            };
            var serialized = JsonConvert.SerializeObject(demoConfig);

            serialized.ToString();
        }
 public CompletedDependencyDescriptor(
     ITypeInspector typeInspector,
     CompleteConfiguration configuration)
     : base(typeInspector, configuration)
 {
 }
示例#4
0
 public DNP3DeviceProfileJan2010Parser(XDocument configFile)
 {
     this.configFile = configFile;
     Configuration   = new CompleteConfiguration();
 }