vs2005 c#
how do i trap max number of row in a collection ?
lets say I can only have max of two rows in a collection
I have this property
const int MaxCount_Submit terEDIContactIn fos = 2;
private void validate_Submit terEDIContactIn fos()
{
if (_SubmitterEDIC ontactInfos.Cou nt >
MaxCount_Submit terEDIContactIn fos)
Set Field Error ( "Too many rows ...bla,bla }
private List<PER_EDICon tact_SubmitterE DIContactInfos;
public List<PER_EDICon tactSubmitterED IContactInfos
{
get { return _SubmitterEDICo ntactInfos; }
set
{
_SubmitterEDICo ntactInfos = value;
validate_Submit terEDIContactIn fos();
}
}
if i do 3 times
SubmitterEDICon tactInfos.Add(n ew PER_EDIContact( file[c++]));
SubmitterEDICon tactInfos.Add(n ew PER_EDIContact( file[c++]));
SubmitterEDICon tactInfos.Add(n ew PER_EDIContact( file[c++]));
the set property is not hit at all, why?
set is only hit from constructor constructor
public SubmitterName()
{
SubmitterEDICon tactInfos = new List<PER_EDICon tact>();
}
how do i trap max number of row in a collection ?
lets say I can only have max of two rows in a collection
I have this property
const int MaxCount_Submit terEDIContactIn fos = 2;
private void validate_Submit terEDIContactIn fos()
{
if (_SubmitterEDIC ontactInfos.Cou nt >
MaxCount_Submit terEDIContactIn fos)
Set Field Error ( "Too many rows ...bla,bla }
private List<PER_EDICon tact_SubmitterE DIContactInfos;
public List<PER_EDICon tactSubmitterED IContactInfos
{
get { return _SubmitterEDICo ntactInfos; }
set
{
_SubmitterEDICo ntactInfos = value;
validate_Submit terEDIContactIn fos();
}
}
if i do 3 times
SubmitterEDICon tactInfos.Add(n ew PER_EDIContact( file[c++]));
SubmitterEDICon tactInfos.Add(n ew PER_EDIContact( file[c++]));
SubmitterEDICon tactInfos.Add(n ew PER_EDIContact( file[c++]));
the set property is not hit at all, why?
set is only hit from constructor constructor
public SubmitterName()
{
SubmitterEDICon tactInfos = new List<PER_EDICon tact>();
}
Comment