Diploma_All
.pdf{
for (int i = 0; i < parentNode.ChildNodes.Count; i++)
{
parentTreeNode.Nodes.Add(CreateTreeNode(parentNode.ChildNodes[i]));
AddChildren(parentNode.ChildNodes[i], parentTreeNode.Nodes[i]);
}
}
}
private DrawnObject FindGlyph(string fullPath)
{
foreach (DrawnObject glyph in DrawnObjects)
{
if (glyph.Value == fullPath) return glyph;
}
return null;
}
private DrawnObject FindGlyph(Point point)
{
List<DrawnObject> matchingGlyphs = new List<DrawnObject>(); DrawnObject lowestGlyph = null;
// Find all matching
foreach (DrawnObject glyph in DrawnObjects)
{
if (glyph.Rectangle.Contains(point)) matchingGlyphs.Add(glyph);
}
// Choose glyph with lowest level if (matchingGlyphs.Count > 0)
{
lowestGlyph = matchingGlyphs[0];
for (int i = 1; i < matchingGlyphs.Count; i++)
{
lowestGlyph = matchingGlyphs[i].Value.Split(Node.PATH_SEPARATOR).Length > lowestGlyph.Value.Split(Node.PATH_SEPARATOR).Length ?
matchingGlyphs[i] : lowestGlyph;
}
}
return lowestGlyph;
}
}
111