[ create a new paste ] login | about

Link: http://codepad.org/nVPmlBfD    [ raw code | fork ]

C, pasted on Mar 20:
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;

    }
}


Create a new paste based on this one


Comments: