using aspnet20_cs_outils;
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class test_picturebrowser : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DataSet ds = new DataSet();
        ds.ReadXml(Server.MapPath("catalogue.xml"));
        PictureBrowser1.DataSource = ds.Tables[0];
        PictureBrowser1.OnNext += new EventHandler(cmd_suiv_click);
        PictureBrowser1.OnPrevious += new EventHandler(cmd_pred_click);
        if (!IsPostBack)
            PictureBrowser1.DataBind();
    }

    protected void cmd_pred_click(object sender, EventArgs e)
    {
        PictureBrowser1.CurrentPictureIndex--;
        PictureBrowser1.DataBind();
    }

    protected void cmd_suiv_click(object sender, EventArgs e)
    {
        PictureBrowser1.CurrentPictureIndex++;
        PictureBrowser1.DataBind();
    }
    protected void ListBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        switch (ListBox1.SelectedIndex)
        {
            case 0:
                PictureBrowser1.Mode = PictureBrowser.PictureMode.Miniature;
                break;
            case 1:
                PictureBrowser1.Mode = PictureBrowser.PictureMode.Picture;
                break;
        }
        PictureBrowser1.DataBind();
    }
}