Example #1
0
 public Entry(string name, InputOutputKey inputOutputKey, XsdObjectType xsdObjectType, IEnumerable <Entry> subEntries)
 {
     this.inputOutputKey = inputOutputKey;
     this.XsdObjectType  = xsdObjectType;
     Name       = name;
     SubEntries = new List <Entry>(subEntries);
 }
Example #2
0
 public SourceItem(string name, XmlSchemaType type, XsdObjectType xsdObjectType, string mappingTargetKey)
 {
     this.xsdObjectType = xsdObjectType;
     Name             = name;
     XsdType          = type;
     MappingTargetKey = mappingTargetKey;
     children         = new List <SourceItem>();
 }
        /// <summary>
        /// Takes an <see cref="XElement"/> representing the root entry as input and returns the root Entry object with all its children
        /// by recursively calling itself.
        /// </summary>
        /// <param name="entryElement"></param>
        /// <param name="mappingFile"></param>
        /// <returns></returns>
        private static Entry ImportEntry(XElement entryElement, string mappingFile)
        {
            InputOutputKey inputOutputKey;
            var            inputKey = (string)entryElement.Attribute("inpkey");

            if (string.IsNullOrEmpty(inputKey))
            {
                var outputKey = (string)entryElement.Attribute("outkey");
                inputOutputKey = string.IsNullOrEmpty(outputKey) ? InputOutputKey.None : InputOutputKey.Output(mappingFile, outputKey);
            }
            else
            {
                inputOutputKey = InputOutputKey.Input(mappingFile, inputKey);
            }
            var           entryTypeStr  = (string)entryElement.Attribute("type");
            XsdObjectType xsdObjectType = XsdObjectType.Element;

            if (entryTypeStr == "attribute")
            {
                xsdObjectType = XsdObjectType.Attribute;
            }
            return(new Entry((string)entryElement.Attribute("name"), inputOutputKey, xsdObjectType, from childElement in entryElement.Elements("entry") select ImportEntry(childElement, mappingFile)));
        }
Example #4
0
 public Entry(string name, InputOutputKey inputOutputKey, XsdObjectType xsdObjectType)
     : this(name, inputOutputKey, xsdObjectType, new Entry[0])
 {
 }