Ejemplo n.º 1
0
    public void ResetTiles()
    {
        removedTile = null;
        blankTile   = null;
        Controls.Clear();

        theme = PuzzleIO.ReadCurrentTheme();
        string[] imageNames = PuzzleIO.ReadThemeImageNames(theme);
        dimension = (int)Math.Sqrt(imageNames.Length);
        Tile currentTile;

        int index = 0;

        foreach (string imageName in imageNames)
        {
            currentTile          = new Tile(index, imageName, this);
            currentTile.Location = GetTileStartingLocation(currentTile);
            Controls.Add(currentTile);

            if (index == 0)
            {
                Width  = currentTile.Width * dimension;
                Height = currentTile.Height * dimension;
            }
            index++;
        }
        Invalidate();
    }
Ejemplo n.º 2
0
    protected override void DoRefreshList()
    {
        string currentTheme = PuzzleIO.ReadCurrentTheme();

        string[] themes = PuzzleIO.ReadAllThemes();

        int index = 0;

        foreach (string theme in themes)
        {
            list.Items.Add(theme);
            if (theme.Equals(currentTheme))
            {
                list.SetSelected(index, true);
            }
            index++;
        }
    }