using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace WindowsFormsApplication2
{
public class Class1
{
public delegate void sampleDelegate(object sender, int index);
public event sampleDelegate IndexChanged;
protected virtual void OnIndexChanged(int index)
{
if (IndexChanged != null)
{
IndexChanged(this, index);
}
}
public int Index
{
set
{
_index = value;
OnIndexChanged(_index);
}
}
private int _index = 0;
}
}