/// <summary> /// Populates the object from an XML representation /// </summary> /// <param name="node">The XML representation of the object</param> private void FromXml(XmlNode node) { XmlAttribute classAttribute = node.Attributes["object-class"]; if (classAttribute == null) { throw new ArgumentNullException("The object class must be specified"); } if (MASchema.Objects.Contains(classAttribute.Value)) { this.ObjectClass = classAttribute.Value; } else { throw new NoSuchObjectTypeException(classAttribute.Value); } foreach (XmlNode operationNode in node.ChildNodes) { if (operationNode.Name == "global-operation" || operationNode.Name == "object-operation") { this.ObjectOperations.Add(OperationBase.CreateObjectOperationFromXmlNode(operationNode)); } } if (MAConfig.Capabilities.DeltaImport) { if (!this.ObjectOperations.Any(t => t is ImportDeltaOperation)) { throw new ArgumentException("A delta import operation must be defined for all objects if the delta capabilities is enabled in the configuration file"); } } }
/// <summary> /// Reads the global-operations xmlNode from the Xml file /// </summary> /// <param name="rootNode">The root xmlNode of the Xml file</param> private static void ReadGlobalOperationsNode(XmlNode rootNode) { GlobalOperations.Clear(); foreach (XmlNode globalOperation in rootNode.SelectNodes("global-operations/global-operation")) { GlobalOperations.Add(OperationBase.CreateObjectOperationFromXmlNode(globalOperation)); } }