示例#1
0
        private static ThingTypeVersionInfo GetVersionInfoFromXml(XPathNavigator versionInfoNav)
        {
            var    versionTypeId   = new Guid(versionInfoNav.GetAttribute("version-type-id", string.Empty));
            string versionName     = versionInfoNav.GetAttribute("version-name", string.Empty);
            int    versionSequence = int.Parse(versionInfoNav.GetAttribute("version-sequence", string.Empty), CultureInfo.InvariantCulture);

            XPathNavigator orderByPropertiesNav = versionInfoNav.SelectSingleNode("order-by-properties");

            if (orderByPropertiesNav == null)
            {
                return(new ThingTypeVersionInfo(
                           versionTypeId,
                           versionName,
                           versionSequence,
                           new ThingTypeOrderByProperties(new List <ThingTypeProperty>(0))));
            }

            ThingTypeOrderByProperties orderByProperties = ThingTypeOrderByProperties.CreateFromXml(orderByPropertiesNav);

            return(new ThingTypeVersionInfo(
                       versionTypeId,
                       versionName,
                       versionSequence,
                       orderByProperties));
        }
 internal ThingTypeVersionInfo(
     Guid versionTypeId,
     string versionName,
     int versionSequence,
     ThingTypeOrderByProperties orderByProperties)
 {
     VersionTypeId     = versionTypeId;
     Name              = versionName;
     VersionSequence   = versionSequence;
     OrderByProperties = orderByProperties;
 }