private void CreateComponents(WorldSettings settings) { ImagesRegistry = new ImagesRegistry(this); ThreadsComponent = new ThreadsCoreComponent(this); ModulesStorage = new ModulesStorageComponent(this); StandaloneStorage = new StandaloneStorageComponent(settings, this); PlatformTypesConvertorsRegistry = new PlatformTypesConvertorsRegistry(Logger); DateTimeProvider = new DateTimeProvider(Logger, ThreadsComponent); LogicQueryParseAndCache = new LogicQueryParseAndCache(settings, this); }
private void LoadTypesPlatformTypesConvertors() { var targetAttributeType = typeof(PlatformTypesConvertorAttribute); var typesList = AppDomainTypesEnumerator.GetTypes().Where(p => p.GetCustomAttributesData().Any(x => x.AttributeType == targetAttributeType)).ToList(); foreach (var type in typesList) { var convertor = (IPlatformTypesConvertor)Activator.CreateInstance(type); PlatformTypesConvertorsRegistry.AddConvertor(convertor); } }
public void AddConvertor(IPlatformTypesConvertor convertor) { PlatformTypesConvertorsRegistry.AddConvertor(convertor); }