private void InitializeTransformationServices() { // Initialize NamedTypeFactory namedTypeFactory = new NamedTypeFactory(transformFile); transformationServiceContainer.AddService(namedTypeFactory.GetType(), namedTypeFactory); // Initialize TransformationLogger transformationServiceContainer.AddService(logger.GetType(), logger); }
private ObjectType CreateObjectFromAttribute <ObjectType>(out string argumentString, out XmlAttribute objectAttribute) where ObjectType : class { objectAttribute = Element.Attributes.GetNamedItem(typeof(ObjectType).Name, XmlTransformation.TransformNamespace) as XmlAttribute; try { if (objectAttribute != null) { string typeName = ParseNameAndArguments(objectAttribute.Value, out argumentString); if (!String.IsNullOrEmpty(typeName)) { NamedTypeFactory factory = GetService <NamedTypeFactory>(); return(factory.Construct <ObjectType>(typeName)); } } } catch (Exception ex) { throw WrapException(ex, objectAttribute); } argumentString = null; return(null); }
private void InitializeTransformationServices() { this.namedTypeFactory = new NamedTypeFactory(this.transformFile); this.transformationServiceContainer.AddService(this.namedTypeFactory.GetType(), this.namedTypeFactory); this.transformationServiceContainer.AddService(this.logger.GetType(), this.logger); }