public XDocument Export(IEnumerable<XPBaseObject> baseCollection, ISerializationConfigurationGroup serializationConfigurationGroup){ var xDocument = new XDocument(); var root = new XElement("SerializedObjects"); xDocument.Add(root); _serializeClassInfoGraphNodesCalculator =new SerializeClassInfoGraphNodesCalculator(serializationConfigurationGroup); foreach (var baseObject in baseCollection) { IEnumerable<IClassInfoGraphNode> serializedClassInfoGraphNodes = _serializeClassInfoGraphNodesCalculator.GetSerializedClassInfoGraphNodes(baseObject); ExportCore(baseObject, serializedClassInfoGraphNodes, root); } return xDocument; }
public XDocument Export(IEnumerable <XPBaseObject> baseCollection, ISerializationConfigurationGroup serializationConfigurationGroup) { var xDocument = new XDocument(); var root = new XElement("SerializedObjects"); xDocument.Add(root); _serializeClassInfoGraphNodesCalculator = new SerializeClassInfoGraphNodesCalculator(serializationConfigurationGroup); foreach (var baseObject in baseCollection) { IEnumerable <IClassInfoGraphNode> serializedClassInfoGraphNodes = _serializeClassInfoGraphNodesCalculator.GetSerializedClassInfoGraphNodes(baseObject); ExportCore(baseObject, serializedClassInfoGraphNodes, root); } return(xDocument); }
void CreateRefElelement(IClassInfoGraphNode classInfoGraphNode, string typeName, XElement root, XPBaseObject theObject, XElement propertyElement) { var serializedObjectRefElement = new XElement("SerializedObjectRef"); propertyElement.Add(serializedObjectRefElement); serializedObjectRefElement.Add(new XAttribute("type", typeName)); serializedObjectRefElement.Add(new XAttribute("strategy", classInfoGraphNode.SerializationStrategy)); if (theObject != null) { IEnumerable <IClassInfoGraphNode> classInfoGraphNodes = _serializeClassInfoGraphNodesCalculator.GetSerializedClassInfoGraphNodes(theObject, typeName); CreateRefKeyElements(classInfoGraphNodes, theObject, serializedObjectRefElement); if (classInfoGraphNode.SerializationStrategy == SerializationStrategy.SerializeAsObject) { ExportCore(theObject, classInfoGraphNodes, root); } } }
void CreateRefElelement(IClassInfoGraphNode classInfoGraphNode, Type objectType, XElement root, object theObject, XElement propertyElement, ElementSchema elementSchema) { var serializedObjectRefElement = new XElement(elementSchema.SerializedObjectRef); propertyElement.Add(serializedObjectRefElement); serializedObjectRefElement.Add(new XAttribute(elementSchema.Type, objectType.Name)); serializedObjectRefElement.Add(new XAttribute(elementSchema.Strategy, classInfoGraphNode.SerializationStrategy)); if (theObject != null) { var classInfoGraphNodes = _serializeClassInfoGraphNodesCalculator.GetSerializedClassInfoGraphNodes(theObject, objectType.Name).ToArray(); CreateRefKeyElements(XafTypesInfo.CastTypeToTypeInfo(objectType), classInfoGraphNodes, theObject, serializedObjectRefElement, elementSchema); if (classInfoGraphNode.SerializationStrategy == SerializationStrategy.SerializeAsObject) { ExportCore(theObject, classInfoGraphNodes, root, elementSchema); } } }
public XDocument Export(IEnumerable <object> baseCollection, ISerializationConfigurationGroup serializationConfigurationGroup) { var xDocument = new XDocument(); _minifyOutput = serializationConfigurationGroup.MinifyOutput; var elementInfo = ElementSchema.Get(_minifyOutput); var root = new XElement(elementInfo.SerializedObjects); root.Add(new XAttribute(ElementSchema.Minified, _minifyOutput)); xDocument.Add(root); _serializeClassInfoGraphNodesCalculator = new SerializeClassInfoGraphNodesCalculator(serializationConfigurationGroup, _objectSpace); foreach (var baseObject in baseCollection) { var serializedClassInfoGraphNodes = _serializeClassInfoGraphNodesCalculator.GetSerializedClassInfoGraphNodes(baseObject); ExportCore(baseObject, serializedClassInfoGraphNodes, root, elementInfo); } return(xDocument); }