Represent the methode that will handle OnError event.

Namespace: EAL.Interfaces.System
Assembly: EAL (in EAL.dll) Version: 1.1.5.0 (1.1.5.0)

Syntax

C#
public delegate void OnErrorEventHandler(
	Object sender,
	TransferErrorEventArgs e
)
Visual Basic
Public Delegate Sub OnErrorEventHandler ( 
	sender As Object,
	e As TransferErrorEventArgs
)
Visual C++
public delegate void OnErrorEventHandler(
	Object^ sender, 
	TransferErrorEventArgs^ e
)

Examples

 Copy imageCopy
private static void Method1()
{
    try
    {
        IEALConnection ealConnection = new EALConnection(false);
        ealConnection.Connect("192.168.0.6");
        ealConnection.System.FirmwareManagement.OnTransfer += new EAL.Interfaces.System.OnTransferEventHandler(FirmwareManagement_OnTransfer);
        ealConnection.System.FirmwareManagement.OnError += new EAL.Interfaces.System.OnErrorEventHandler(FirmwareManagement_OnError);
        ealConnection.System.FirmwareManagement.OnFinish += new EAL.Interfaces.System.OnFinishEventHandler(FirmwareManagement_OnFinish);                

        ealConnection.Motion.Axes[0].SetCondition(AxisCondition.AXIS_CONDITION_ACTIVE_PARAMETERIZATION);                
        string fileName = ealConnection.System.FirmwareManagement.GetFirmwareFilename();
        string dstPath = Path.Combine(@"D:\", fileName);
        ealConnection.System.FirmwareManagement.GetFirmwareFile(dstPath);

        ealConnection.System.Reboot();                
        Console.WriteLine("Rebooted.");
    }
    catch (FwMngmtEALException ex)
    {
        Console.WriteLine("Download could not be carried out. Message:" + ex.Message);
    }
    catch (Exception ex)
    {
        Console.WriteLine("Un known error. Message:" + ex.Message);
    }
}

private static void FirmwareManagement_OnTransfer(object sender, TransferDataEventArgs e)
{
    const string msgFormat = "On transfer.  BytesTransferred:{0}, BytesTotal:{1}";
    string dispMsg = string.Format(msgFormat, e.BytesTransferred, e.BytesTotal);
    Console.WriteLine(dispMsg);
}

private static void FirmwareManagement_OnError(object sender, TransferErrorEventArgs e)
{
    const string msgFormat = "On error.  ErrorCode:{0}, ErrorMessage:{1}";
    string dispMsg = string.Format(msgFormat, e.ErrorCode, e.ErrorMessage);
    Console.WriteLine(dispMsg);
}

private static void FirmwareManagement_OnFinish(object sender, TransferFinishEventArgs e)
{
    const string msgFormat = "On finish.  BytesTransferred:{0}";
    string dispMsg = string.Format(msgFormat, e.BytesTransferred);
    Console.WriteLine(dispMsg);
}

See Also