public static IElementDefinition Create(DescriptorBase descriptor, IElementConfiguration configuration) { switch (descriptor) { case AppenderDescriptor appenderDescriptor: return(CreateAppenderDefinition(appenderDescriptor, configuration)); case FilterDescriptor filterDescriptor: return(CreateFilterDefinition(filterDescriptor)); case LoggerDescriptor loggerDescriptor: return(CreateLoggerDefinition(loggerDescriptor, configuration)); case MappingDescriptor mappingDescriptor: return(new MappingDefinition()); case RendererDescriptor rendererDescriptor: return(new RendererDefinition()); case ParamDescriptor paramDescriptor: return(new ParamDefinition(configuration)); default: throw new ArgumentException($"Property definitions do not exist for {descriptor.GetType().Name}"); } }
internal static IWindowSizeLocation Create(DescriptorBase descriptor) { switch (descriptor) { case AppenderDescriptor appenderDescriptor: return(new AppenderWindowSizeLocation()); case FilterDescriptor filterDescriptor: return(CreateFilterSizeLocation(filterDescriptor)); case LoggerDescriptor loggerDescriptor: return(new LoggerWindowSizeLocation()); case MappingDescriptor mappingDescriptor: return(new FilterWindowSizeLocation()); case RendererDescriptor rendererDescriptor: return(new RendererWindowSizeLocation()); case ParamDescriptor paramDescriptor: return(new StringMatchFilterWindowSizeLocation()); default: throw new ArgumentException($"Window size & locations do not exist for {descriptor.GetType().Name}"); } }