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 DimensionRight(bool includeMe) { int width = 0; int height = 0; if (includeMe) { width = Screen.Dimension.Width; height = Screen.Dimension.Height; } if (NeighborRight != null) { var dimensionRight = NeighborRight.DimensionRight(includeMe: true); width += dimensionRight.Width; if (dimensionRight.Height > height) { height = dimensionRight.Height; } } var dimension = new Rectangle(0, 0, width, height); return(dimension); }