当前位置: 首页>>代码示例>>C#>>正文


C# XmlNode.GetXmlNodeValue方法代码示例

本文整理汇总了C#中System.Xml.XmlNode.GetXmlNodeValue方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNode.GetXmlNodeValue方法的具体用法?C# XmlNode.GetXmlNodeValue怎么用?C# XmlNode.GetXmlNodeValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Xml.XmlNode的用法示例。


在下文中一共展示了XmlNode.GetXmlNodeValue方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: LoadRequiredFields

        private static bool LoadRequiredFields(XmlNode inputNode, ValuePresentation unit)
        {
            var offsetValue = inputNode.GetXmlNodeValue("@B");
            var scaleValue = inputNode.GetXmlNodeValue("@C");
            var decimalDigitsValue = inputNode.GetXmlNodeValue("@D");

            if (string.IsNullOrEmpty(offsetValue) ||
                string.IsNullOrEmpty(scaleValue) ||
                string.IsNullOrEmpty(decimalDigitsValue))
                return false;

            long offset;
            if (!long.TryParse(offsetValue, NumberStyles.Integer, CultureInfo.InvariantCulture, out offset))
                return false;
            unit.Offset = offset;

            double scale;
            if (!double.TryParse(scaleValue, NumberStyles.Number, CultureInfo.InvariantCulture, out scale) ||
                scale < 0)
                return false;
            unit.Scale = scale;

            byte decimalDigits;
            if (!byte.TryParse(decimalDigitsValue, NumberStyles.Integer, CultureInfo.InvariantCulture, out decimalDigits) ||
                decimalDigits < 0 || decimalDigits > 7)
                return false;
            unit.DecimalDigits = decimalDigits;

            return true;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:30,代码来源:UnitLoader.cs

示例2: LoadCellDimensions

        private bool LoadCellDimensions(XmlNode inputNode)
        {
            double gridCellSizeLatitude;
            if (!inputNode.GetXmlNodeValue("@C").ParseValue(out gridCellSizeLatitude) ||
                gridCellSizeLatitude < 0 || gridCellSizeLatitude > 1)
                return false;

            double gridCellSizeLongitude;
            if (!inputNode.GetXmlNodeValue("@D").ParseValue(out gridCellSizeLongitude) ||
                gridCellSizeLongitude < 0 || gridCellSizeLongitude > 1)
                return false;

            int columnCount;
            if (!inputNode.GetXmlNodeValue("@E").ParseValue(out columnCount) ||
                columnCount < 0)
                return false;

            int rowCount;
            if (!inputNode.GetXmlNodeValue("@F").ParseValue(out rowCount) ||
                rowCount < 0)
                return false;

            _descriptor.ColumnCount = columnCount;
            _descriptor.RowCount = rowCount;
            _descriptor.CellHeight = new NumericRepresentationValue(null, new NumericValue(null, gridCellSizeLatitude));
            _descriptor.CellWidth = new NumericRepresentationValue(null, new NumericValue(null, gridCellSizeLongitude));

            return true;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:29,代码来源:GridLoader.cs

示例3: LoadDataVariable

        private DataVariable LoadDataVariable(XmlNode inputNode)
        {
            var ddiValue = inputNode.GetXmlNodeValue("@A");
            if (string.IsNullOrEmpty(ddiValue))
                return null;

            var ddi = Convert.ToInt32(ddiValue, 16);

            long dataValue;
            if (!inputNode.GetXmlNodeValue("@B").ParseValue(out dataValue))
                dataValue = 0;

            var userUnit = _taskDocument.Units.FindById(inputNode.GetXmlNodeValue("@E"));

            var unit = UnitFactory.Instance.GetUnitByDdi(ddi);

            var dataVariable = new DataVariable
            {
                Ddi = ddi,
                Value = unit.ConvertFromIsoUnit(dataValue),
                ProductId = inputNode.GetXmlNodeValue("@C"),
                IsoUnit = unit,
                UserUnit = userUnit.ToAdaptUnit()
            };

            return dataVariable;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:27,代码来源:TreatmentZoneLoader.cs

示例4: GetGpsSource

        private static GpsSource GetGpsSource(XmlNode inputNode)
        {
            var gpsSource = new GpsSource();

            gpsSource.SourceType = GetSourceType(inputNode.GetXmlNodeValue("@I"));
            gpsSource.HorizontalAccuracy = GetAccuracy(inputNode.GetXmlNodeValue("@J"));
            gpsSource.VerticalAccuracy = GetAccuracy(inputNode.GetXmlNodeValue("@K"));
            return gpsSource;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:9,代码来源:GuidancePatternLoader.cs

示例5: LoadPoint

        public static Point LoadPoint(XmlNode pointNode)
        {
            double latitude, longitude;
            if (pointNode.GetXmlNodeValue("@C").ParseValue(out latitude) == false ||
                pointNode.GetXmlNodeValue("@D").ParseValue(out longitude) == false)
                return null;

            var point = new Point();
            point.X = longitude;
            point.Y = latitude;

            return point;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:13,代码来源:ShapeLoader.cs

示例6: GetGpsSource

        private static GpsSource GetGpsSource(XmlNode inputNode)
        {
            var gpsSource = new GpsSource
            {
                SourceType = GetSourceType(inputNode.GetXmlNodeValue("@D"))
            };

            int satelliteCount;
            if (inputNode.GetXmlNodeValue("@G").ParseValue(out satelliteCount))
                gpsSource.NumberOfSatellites = satelliteCount;

            gpsSource.GpsUtcTime = GetGpsTime(inputNode);

            return gpsSource;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:15,代码来源:AllocationTimestampLoader.cs

示例7: LoadVariety

        private static CropVariety LoadVariety(XmlNode inputNode, out string varietyId)
        {
            varietyId = inputNode.GetXmlNodeValue("@A");
            var description = inputNode.GetXmlNodeValue("@B");
            if (string.IsNullOrEmpty(varietyId) || string.IsNullOrEmpty(description))
                return null;

            var variety = new CropVariety
            {
                ProductType = ProductTypeEnum.Variety,
                Description = description
            };
            variety.Id.UniqueIds.Add(ImportHelper.CreateUniqueId(varietyId));

            return variety;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:16,代码来源:CropVarietyLoader.cs

示例8: LoadGuidanceGroup

        private static GuidanceGroupDescriptor LoadGuidanceGroup(XmlNode inputNode, out string groupId)
        {
            groupId = inputNode.GetXmlNodeValue("@A");
            if (string.IsNullOrEmpty(groupId))
                return null;

            var group = new GuidanceGroup();
            group.Description = inputNode.GetXmlNodeValue(@"B");

            group.BoundingPolygon = ShapeLoader.LoadPolygon(inputNode.SelectNodes("PLN[0]"));

            var patterns = GuidancePatternLoader.LoadGuidancePatterns(inputNode.SelectNodes("GPN"));
            group.GuidancePatternIds = patterns.Values.Select(x => x.Id.ReferenceId).ToList();

            return new GuidanceGroupDescriptor(group, patterns);
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:16,代码来源:GuidanceGroupLoader.cs

示例9: LoadCrop

        private Crop LoadCrop(XmlNode inputNode, out string cropId)
        {
            var crop = new Crop();

            // Required fields. Do not proceed if they are missing
            cropId = inputNode.GetXmlNodeValue("@A");
            crop.Name = inputNode.GetXmlNodeValue("@B");
            if (cropId == null || crop.Name == null)
                return null;
            crop.Id.UniqueIds.Add(ImportHelper.CreateUniqueId(cropId));

            // Optional fields
            LoadVarieties(inputNode, crop);

            _taskDocument.LoadLinkedIds(cropId, crop.Id);
            return crop;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:17,代码来源:CropLoader.cs

示例10: IsProductMix

        private static bool IsProductMix(XmlNode inputNode)
        {
            var productType = inputNode.GetXmlNodeValue("@F");

            return !string.IsNullOrEmpty(productType) &&
                string.Equals(productType, "2", StringComparison.OrdinalIgnoreCase) &&
                inputNode.SelectNodes("PRN").Count > 0;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:8,代码来源:ProductLoader.cs

示例11: LoadLink

        private static UniqueId LoadLink(XmlNode inputNode, out string linkId)
        {
            linkId = inputNode.GetXmlNodeValue("@A");
            if (string.IsNullOrEmpty(linkId))
                return null;

            var linkValue = inputNode.GetXmlNodeValue("@B");
            if (string.IsNullOrEmpty(linkValue))
                return null;

            var uniqueId = new UniqueId
            {
                Id = linkValue,
                Source = inputNode.GetXmlNodeValue("@C")
            };

            return uniqueId;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:18,代码来源:LinkGroupLoader.cs

示例12: VerifyRootNode

        private static bool VerifyRootNode(XmlNode rootNode)
        {
            var majorVersion = rootNode.GetXmlNodeValue("@VersionMajor");
            IsoVersionEnum isoVersion;
            if (majorVersion == null || Enum.TryParse(majorVersion, true, out isoVersion) == false ||
                isoVersion != IsoVersionEnum.Standard_V2_Final_Draft)
                return false;

            return true;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:10,代码来源:LinkListLoader.cs

示例13: LoadLinkedGroup

        private static void LoadLinkedGroup(XmlNode inputNode)
        {
            var groupId = inputNode.GetXmlNodeValue("@A");
            if (string.IsNullOrEmpty(groupId))
                return;

            var groupTypeValue = inputNode.GetXmlNodeValue("@B");
            if (string.IsNullOrEmpty(groupTypeValue))
                return;

            var manufacturerGln = inputNode.GetXmlNodeValue("@C");
            var groupNamespace = inputNode.GetXmlNodeValue("@D");
            if (groupTypeValue.Equals("2", StringComparison.OrdinalIgnoreCase) &&
                string.IsNullOrEmpty(manufacturerGln))
                return;

            var linkNodes = inputNode.SelectNodes("LNK");
            LoadLinks(linkNodes, groupTypeValue, manufacturerGln, groupNamespace);
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:19,代码来源:LinkGroupLoader.cs

示例14: AssignCustomer

 private void AssignCustomer(XmlNode inputNode, Farm farm)
 {
     var customerId = inputNode.GetXmlNodeValue("@I");
     if (string.IsNullOrEmpty(customerId) == false)
     {
         var customer = _taskDocument.Customers.FindById(customerId);
         if (customer != null)
             farm.GrowerId = customer.Id.ReferenceId;
     }
 }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:10,代码来源:FarmLoader.cs

示例15: AssignFarm

        private void AssignFarm(XmlNode inputNode, Field field)
        {
            var farmId = inputNode.GetXmlNodeValue("@F");
            if (string.IsNullOrEmpty(farmId))
                return;

            var farm = _taskDocument.Farms.FindById(farmId);
            if (farm != null)
                field.FarmId = farm.Id.ReferenceId;
        }
开发者ID:ADAPT,项目名称:ISOv4Plugin,代码行数:10,代码来源:FieldLoader.cs


注:本文中的System.Xml.XmlNode.GetXmlNodeValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。