public PreviewLine(PreviewPoint point1, PreviewPoint point2, int lightCount, ElementNode selectedNode, double zoomLevel)
{
AddStartPadding = false;
ZoomLevel = zoomLevel;
AddPoint(PointToZoomPoint(point1));
AddPoint(PointToZoomPoint(point2));
if (selectedNode != null) {
List<ElementNode> children = PreviewTools.GetLeafNodes(selectedNode);
// is this a single node?
if (children.Count == 0) {
StringType = StringTypes.Standard;
// Just add the pixels, they will get layed out next
for (int lightNum = 0; lightNum < lightCount; lightNum++) {
PreviewPixel pixel = AddPixel(10, 10);
pixel.PixelColor = Color.White;
if (selectedNode.IsLeaf)
pixel.Node = selectedNode;
}
}
else {
StringType = StringTypes.Pixel;
lightCount = children.Count;
// Just add the pixels, they will get layed out next
foreach (ElementNode child in children) {
{
PreviewPixel pixel = AddPixel(10, 10);
pixel.Node = child;
pixel.NodeId = child.Id;
pixel.PixelColor = Color.White;
}
}
}
}
else {
// Just add the pixels, they will get layed out next
for (int lightNum = 0; lightNum < lightCount; lightNum++) {
//Console.WriteLine("Added: " + lightNum.ToString());
PreviewPixel pixel = AddPixel(10, 10);
pixel.PixelColor = Color.White;
}
}
// Lay out the pixels
Layout();
}