本文整理汇总了C#中System.Xml.XmlNode.FirstChildWithName方法的典型用法代码示例。如果您正苦于以下问题:C# XmlNode.FirstChildWithName方法的具体用法?C# XmlNode.FirstChildWithName怎么用?C# XmlNode.FirstChildWithName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlNode
的用法示例。
在下文中一共展示了XmlNode.FirstChildWithName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExtractCalibLinesFromRaw
private void ExtractCalibLinesFromRaw(XmlNode extractorNode)
{
// TODO: Move Extractor initialization to other method
// <PointsExtractor type="CalibShape">
// <Parameters>....
CalibrationModule.CalibrationPointsFinder pointsExtractor;
CalibrationModule.ICalibrationLinesExtractor linesExtractor;
if(extractorNode == null)
{
pointsExtractor = new CalibrationModule.ShapesGridCPFinder();
linesExtractor = pointsExtractor.LinesExtractor;
pointsExtractor.InitParameters();
pointsExtractor.UpdateParameters();
pointsExtractor.PrimaryShapeChecker = new CalibrationModule.RedNeighbourhoodChecker();
}
else
{
// Get type of extractor
string extractorType = extractorNode.Attributes["type"].Value;
if(extractorType == "CalibShape") { }
pointsExtractor = new CalibrationModule.ShapesGridCPFinder();
linesExtractor = pointsExtractor.LinesExtractor;
pointsExtractor.InitParameters();
XmlNode paramsNode = extractorNode.FirstChildWithName("Parameters");
if(paramsNode != null)
{
AlgorithmParameter.ReadParametersFromXml(pointsExtractor.Parameters, paramsNode);
}
pointsExtractor.UpdateParameters();
}
for(int i = 0; i < _calibImagesIndices.Count; ++i)
{
ImageIndex idx = _calibImagesIndices[i];
ColorImage image = _rawCalibImages[idx.ListIndex];
pointsExtractor.Image = image;
pointsExtractor.FindCalibrationPoints();
linesExtractor.ExtractLines();
}
}
示例2: CreateFromNode
public static DisparityMap CreateFromNode(XmlNode mapNode)
{
int rows = int.Parse(mapNode.Attributes["rows"].Value);
int cols = int.Parse(mapNode.Attributes["cols"].Value);
DisparityMap map = new DisparityMap(rows, cols);
XmlNode rowNode = mapNode.FirstChildWithName("Row");
for(int r = 0; r < rows; ++r)
{
XmlNode dispNode = rowNode.FirstChildWithName("Disparity");
for(int c = 0; c < cols; ++c)
{
Disparity disp = Disparity.CreateFromNode(dispNode);
map.Disparities[r, c] = disp;
dispNode = dispNode.NextSibling;
}
rowNode = rowNode.NextSibling;
}
return map;
}