034e1dcef8
* solidx converter added * some formatting * version bump * supress the check * dwg based dataobject * replace dwg with sat * update sdk package * some cleanup * change operation order * some formatting * ITypedConverter cast * static to ITypedConverter * minors * non-nullable parameters * unit conversion added --------- Co-authored-by: Oğuzhan Koral <45078678+oguzhankoral@users.noreply.github.com>
37 lines
1.4 KiB
C#
37 lines
1.4 KiB
C#
using System.Reflection;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using Speckle.Converters.Autocad.ToHost.Helpers;
|
|
using Speckle.Converters.AutocadShared.ToSpeckle;
|
|
using Speckle.Converters.Common;
|
|
using Speckle.Converters.Common.Registration;
|
|
using Speckle.Sdk;
|
|
|
|
namespace Speckle.Converters.Autocad;
|
|
|
|
public static class ServiceRegistration
|
|
{
|
|
public static void AddAutocadConverters(this IServiceCollection serviceCollection)
|
|
{
|
|
var converterAssembly = Assembly.GetExecutingAssembly();
|
|
//register types by default
|
|
serviceCollection.AddMatchingInterfacesAsTransient(converterAssembly);
|
|
// add single root converter
|
|
serviceCollection.AddRootCommon<AutocadRootToSpeckleConverter>(converterAssembly);
|
|
|
|
// add application converters and context stack
|
|
serviceCollection.AddApplicationConverters<AutocadToSpeckleUnitConverter, ADB.UnitsValue>(converterAssembly);
|
|
serviceCollection.AddScoped<
|
|
IConverterSettingsStore<AutocadConversionSettings>,
|
|
ConverterSettingsStore<AutocadConversionSettings>
|
|
>();
|
|
serviceCollection.AddMatchingInterfacesAsTransient(Assembly.GetExecutingAssembly());
|
|
|
|
// add other classes
|
|
serviceCollection.AddScoped<PropertiesExtractor>();
|
|
serviceCollection.AddScoped<IPropertiesExtractor, PropertiesExtractor>();
|
|
serviceCollection.AddScoped<ExtensionDictionaryExtractor>();
|
|
serviceCollection.AddScoped<XDataExtractor>();
|
|
serviceCollection.AddScoped<EntityUnitConverter>();
|
|
}
|
|
}
|