Checks the business rules on the current row returned error.private void TbCadastroBO_CheckRulesOnCurrentRow(CheckRulesEventArgs e)
{
if (this.Foto.Width > 110 || this.Foto.Height > 150)
this.AddBrokenRule(TbCadastroBOFieldNames.Foto, "Foto com dimensão inválida");
if (this.Foto.HorizontalResolution > 210 || this.Foto.HorizontalResolution < 80
|| this.Foto.VerticalResolution > 210 || this.Foto.VerticalResolution < 80)
this.AddBrokenRule(TbCadastroBOFieldNames.Foto, "Foto com resolução inválida");
}
Returned error in get (try{..}): System.StackOverflowException was unhandled
{Cannot evaluate expression because the current thread is in a stack overflow state.}
[Browsable(false),
BusinessFieldDisplayInEditor(),
Description("Foto"),
DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public System.Drawing.Bitmap Foto
{
get
{
try
{
return (System.Drawing.Bitmap)this.BinaryFormatter.Deserialize(new MemoryStream((Byte[])this.CurrentRow["Foto"]));
}
catch
{
return null;
}
}
set
{
MemoryStream loStream = new MemoryStream();
this.BinaryFormatter.Serialize(loStream, value);
this.CurrentRow["Foto"] = loStream.ToArray();
}
}