If you just need this internally in the class, then either create a SetCardSerial method or create a property and use the setter.
If you want an event that is accessible outside the class then you will need something like this:
public class YourClass
{
public event EventHandler CardSerialNumberChanged;
private string cardSerialNo;
public string CardSerialNo
{
get
{
if (cardSerialNo == null)
return string.Empty;
else
return cardSerialNo;
}
set
{
if (value == string.Empty)
value = null;
if (cardSerialNo != value)
{
cardSerialNo = value;
OnCardSerialNumberChanged(EventArgs.Empty);
}
}
}
protected virtual void OnCardSerialNumberChanged(EventArgs e)
{
EventHandler eh = CardSerialNumberChanged;
if (eh != null) eh(this, e);
}
}