DataGridViewRowToEmailParticipantCriteria
(
DataGridViewRow oRow
)
{
Debug.Assert(oRow != null);
AssertValid();
EmailParticipantCriteria oEmailParticipantCriteria =
new EmailParticipantCriteria();
String sParticipant =
(String)oRow.Cells[this.colParticipant.Name].Value;
if ( !String.IsNullOrEmpty(sParticipant) )
{
// Trim the participant string.
sParticipant = sParticipant.Trim();
oRow.Cells[this.colParticipant.Name].Value = sParticipant;
}
if ( !String.IsNullOrEmpty(sParticipant) )
{
sParticipant = ParticipantToAnalyzer(sParticipant);
}
oEmailParticipantCriteria.Participant = sParticipant;
IncludedIn eIncludedIn = IncludedIn.None;
if ( DataGridViewCheckBoxCellIsChecked(oRow, this.colFrom.Name) )
{
eIncludedIn |= IncludedIn.From;
}
if ( DataGridViewCheckBoxCellIsChecked(oRow, this.colTo.Name) )
{
eIncludedIn |= IncludedIn.To;
}
if ( DataGridViewCheckBoxCellIsChecked(oRow, this.colCc.Name) )
{
eIncludedIn |= IncludedIn.Cc;
}
if ( DataGridViewCheckBoxCellIsChecked(oRow, this.colBcc.Name) )
{
eIncludedIn |= IncludedIn.Bcc;
}
oEmailParticipantCriteria.IncludedIn = eIncludedIn;
return (oEmailParticipantCriteria);
}