Dear Friends,
I have downloaded the sample project of slideshow from one of the project. The Project is working well. But i cant understand the coding that is involved in it. I want to know what is the use of each term in it. Can any help me in solving out.
public class ImageItem
{
private string _ToolTip = string.Empty;
public string ToolTip
{
get { return _ToolTip; }
set { _ToolTip = value; }
}
private string _URL = string.Empty;
public string URL
{
get { return _URL; }
set { _URL = value; }
}
// Default constructor.
public ImageItem()
{ }
public ImageItem(string ToolTip, string URL)
{
this._ToolTip = ToolTip;
this._URL = URL;
}
}
public class ImageItems : List<ImageItem>
{
public ImageItems()
{ }
}
public class SlideShowImageEventArgs : EventArgs
{
private ImageButton _ImageButton = null;
private int _X = 0;
private int _Y = 0;
public int X
{
get { return _X; }
}
public int Y
{
get { return _Y; }
}
public string URL
{
get { return _ImageButton.ImageUrl; }
}
public string ToolTip
{
get { return _ImageButton.ToolTip; }
}
public SlideShowImageEventArgs(ImageButton O, int X, int Y)
{
_ImageButton = O;
_X = X;
_Y = Y;
}
}
//Delegate that represents the Click event signature for SlideShow control.
public delegate void SlideShowClick(object sender, SlideShowImageEventArgs e);
--------------------------------------------------------------------------------------------------------------------------
-----------------------------End of the Coding ------------------------------------------------------------------
In this coding they have used get and set methods. What is the use of it? Why we are using it?
EG:
private string _Title = string.Empty;
public string Title
{
get { return _Title; }
set { _Title = value; }
}
private HorizontalAlign _ArrowAlign = HorizontalAlign.NotSet;
public HorizontalAlign ArrowAlign
{
get { return _ArrowAlign; }
set { _ArrowAlign = value; }
}
Thanks and Regards,
GokulNath Nithy.