public void TraverseDepthFirst(IMappingVisitor visitor) { visitor.VisitBeforeChildren(this); foreach (var child in Children) { child.TraverseDepthFirst(visitor); } visitor.VisitAfterChildren(this); }
public void AcceptForAll(IMappingVisitor visitor) { visitor.Begin(); bool first = true; foreach (var typePair in this.aDefinitionContainer.VisitableMappings) { var mapping = this.GetMapping(typePair.From, typePair.To); if (!first) { visitor.Next(); } first = false; mapping.Accept(visitor); } visitor.End(); }
public MappingWalker(IMappingVisitor visitor) { visitor.ThrowIfNull(nameof(visitor)); _visitor = visitor; }
public void Accept(IMappingVisitor visitor) { var walker = new MappingWalker(visitor); walker.Accept(this); }
public void Accept(IMappingVisitor visitor) { visitor.Visit(this); }
public MappingWalker(IMappingVisitor visitor) { _visitor = visitor; }
public void Write(XmlElement classElement, IMappingVisitor visitor) { throw new System.NotImplementedException(); }
public void Write(XmlElement classElement, IMappingVisitor visitor) { var versionElement = classElement .AddElement("version") .WithProperties(properties); if (neverGenerated) { versionElement.WithAtt("generated", "never"); } if (Property.PropertyType == typeof(DateTime)) { versionElement.WithAtt("type", "timestamp"); } }
public void Write(XmlElement classElement, IMappingVisitor visitor) { }
public MappingWalker(IMappingVisitor visitor) { visitor.ThrowIfNull("visitor"); _visitor = visitor; }
public void Write(XmlElement classElement, IMappingVisitor visitor) { XmlElement element = classElement.AddElement("id") .WithAtt("name", property.Name) .WithAtt("type", TypeMapping.GetTypeString(property.PropertyType)); if (unsavedValue != null) element.WithAtt("unsaved-value", unsavedValue.ToString()); elementAttributes.ForEachPair((name, value) => element.WithAtt(name, value)); XmlElement generatorElement = element.AddElement("generator").WithAtt("class", GeneratorClass); generatorParameters.ForEachPair( (name, innerXml) => generatorElement.AddElement("param").WithAtt("name", name).InnerXml = innerXml); }
public void Write(XmlElement classElement, IMappingVisitor visitor) { if (!IsDirty) return; var cacheElement = classElement.AddElement("cache") .WithAtt("usage", usage); if (!string.IsNullOrEmpty(region)) cacheElement.WithAtt("region", region); cacheElement.WithProperties(attributes); }