C
coder
I downloaded the C# Mobile Line of Business Solution Accelerator sample
app from MSDN and the UI code has DoEvents sprinkled all over the
place. It is tagged as a "best practices" sample but I've read from
many people that DoEvents is hardly ever appropriate. If anyone has
seen this code -- do you think this usage of DoEvents is appropriate?
Here's a sample of what I'm talking about:
/// <summary>
/// Replicate with SQL Server 2005
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void menuItemSync_Click(object sender, EventArgs e)
{
Application.DoEvents();
Cursor.Current = Cursors.WaitCursor;
Application.DoEvents();
try
{
//Test to see if Network is available
Application.DoEvents();
statusBar1.Text = "Checking network connectivity...";
Application.DoEvents();
if (Business.Services.GetConnectionStatus())
{
//Test to see if Replication URL is reachable
Application.DoEvents();
statusBar1.Text = "Testing IIS server...";
Application.DoEvents();
if (Business.Services.CheckReplicationUrl())
app from MSDN and the UI code has DoEvents sprinkled all over the
place. It is tagged as a "best practices" sample but I've read from
many people that DoEvents is hardly ever appropriate. If anyone has
seen this code -- do you think this usage of DoEvents is appropriate?
Here's a sample of what I'm talking about:
/// <summary>
/// Replicate with SQL Server 2005
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void menuItemSync_Click(object sender, EventArgs e)
{
Application.DoEvents();
Cursor.Current = Cursors.WaitCursor;
Application.DoEvents();
try
{
//Test to see if Network is available
Application.DoEvents();
statusBar1.Text = "Checking network connectivity...";
Application.DoEvents();
if (Business.Services.GetConnectionStatus())
{
//Test to see if Replication URL is reachable
Application.DoEvents();
statusBar1.Text = "Testing IIS server...";
Application.DoEvents();
if (Business.Services.CheckReplicationUrl())