public List <IMosaicItem> GetNeighbors() { var nodes = new List <IMosaicItem>(); if (NeighborTop != null) { nodes.Add(NeighborTop); nodes.AddRange(NeighborTop.GetNeighbors()); } if (NeighborRight != null) { nodes.Add(NeighborRight); nodes.AddRange(NeighborRight.GetNeighbors()); } if (NeighborBottom != null) { nodes.Add(NeighborBottom); nodes.AddRange(NeighborBottom.GetNeighbors()); } if (NeighborLeft != null) { nodes.Add(NeighborLeft); nodes.AddRange(NeighborLeft.GetNeighbors()); } return(nodes); }
public Rectangle DimensionBottom(bool includeMe) { int width = 0; int height = 0; //Only the bottom dimension neighbor exists, the value of the caller is considered if (includeMe) { width = Screen.Dimension.Width; height = Screen.Dimension.Height; } if (NeighborBottom != null) { var dimensionBottom = NeighborBottom.DimensionBottom(includeMe: true); if (dimensionBottom.Width > width) { width = dimensionBottom.Width; } height += dimensionBottom.Height; } var dimension = new Rectangle(0, 0, width, height); return(dimension); }