public static ExternalProvider GetExternalProviderImpl(string service) { ExternalProvider externalProviderImpl = null; if (GetGXServices() != null) { GXService providerService = GetGXServices().Get(service); if (providerService != null) { try { string typeFullName = providerService.ClassName; GXLogging.Debug(log, "Loading storage provider:", typeFullName); #if !NETCORE Type type = Type.GetType(typeFullName, true, true); #else Type type = new AssemblyLoader(FileUtil.GetStartupDirectory()).GetType(typeFullName); #endif externalProviderImpl = (ExternalProvider)Activator.CreateInstance(type); } catch (Exception e) { GXLogging.Error(log, "CouldnĀ“t connect to external storage provider.", e.Message, e); throw e; } } } return(externalProviderImpl); }
private void ProcessService(GXXMLReader reader) { reader.ReadType(1, "Name"); String name = reader.Value; reader.ReadType(1, "Type"); String type = reader.Value; reader.ReadType(1, "ClassName"); String className = reader.Value; String allowMultiple = string.Empty; reader.Read(); if (reader.Name == "AllowMultiple") { allowMultiple = reader.Value; reader.Read(); } GXProperties properties = ProcessProperties(type, name, reader); GXService service = new GXService(); service.Name = name; service.Type = type; service.ClassName = className; service.Properties = properties; service.AllowMultiple = string.IsNullOrEmpty(allowMultiple) ? false : bool.Parse(allowMultiple); if (service.AllowMultiple) { services.Add($"{service.Type}:{service.Name}", service); } else { services.Add(type, service); } }