Beispiel #1
0
        private string GetName(Xml.EnumEntry xEnumEntry)
        {
            if (_enumEntryNameTransformation == null)
            {
                return(xEnumEntry.Name);
            }

            return(_enumEntryNameTransformation.Transform(xEnumEntry));
        }
Beispiel #2
0
 private Data.EnumEntry ToModel(Xml.EnumEntry xEnumEntry)
 {
     Data.EnumEntry dEnumEntry = new Data.EnumEntry();
     dEnumEntry.XmlDefinition = xEnumEntry;
     dEnumEntry.Name          = GetName(xEnumEntry);
     dEnumEntry.Value         = GetNullableInt(xEnumEntry.Value);
     dEnumEntry.Description   = StringHelper.TrimAndNormalizeCarriageReturn(xEnumEntry.Description);
     dEnumEntry.Parameters    = ToModels(xEnumEntry.Parameters);
     return(dEnumEntry);
 }
Beispiel #3
0
        private static Xml.EnumEntry ToEnumEntry(XElement xElement)
        {
            Xml.EnumEntry enumEntry = new Xml.EnumEntry();

            enumEntry.Name = xElement.Attribute("name")?.Value;

            enumEntry.Value = xElement.Attribute("value")?.Value;

            XElement descriptionElement = xElement.Element(XName.Get("description"));

            enumEntry.Description = descriptionElement?.Value;

            IEnumerable <XElement> paramElements = xElement.Elements(XName.Get("param"));

            enumEntry.Parameters = ToParameters(paramElements);

            return(enumEntry);
        }