Can you tell me what is the exact usage of properties in C# i mean practical explanation
in our project we are using properties like
/// <summary>
/// column order
/// </summary>
protected int m_order;
/// <summary>
/// Get/Set column order
/// </summary>
public int Order
{
get { return m_order; }
set { m_order = value; }
}
/// <summary>
/// constructor
/// </summary>
/// <param name="name">column name</param>
/// <param name="width">column width</param>
/// <param name="order">column order</param>
public ViewColumn(string name, int width, int order)
{
//
// TODO: Add constructor logic here
//
m_name = name;
m_width = width;
m_order = order;
}
/// <summary>
/// returns the column name, width, and order in list view.
/// </summary>
/// <returns>string represent of the ViewColumn object</returns>
public override string ToString()
{
return (string.Format("column name = {0}, width = {1}, order = {2}.",
m_name, m_width, m_order));
}
/// <summary>
/// Do a comparison of 2 ViewColumn object to see if they're identical.
/// </summary>
/// <param name="vc">ViewColumn object for comparison</param>
/// <returns>True if the objects are identical, False otherwise.</returns>
public override bool Equals(object obj)
{
ViewColumn vc = (ViewColumn)obj;
if(m_name == vc.Name &&
m_width == vc.Width &&
m_order == vc.Order)
return true;
else
return false;
}