void eraseUpdate([In, MarshalAs(UnmanagedType.IDispatch)] object sender, int waktuBerjalan, int waktuTotal) { IDiscFormat2Erase Format = (IDiscFormat2Erase)sender; int persenProses = waktuBerjalan * 100 / waktuTotal; backgroundWorker.ReportProgress(persenProses); }
/// <summary> /// Event Handler for the Erase Progress Updates /// </summary> /// <param name="sender"></param> /// <param name="elapsedSeconds"></param> /// <param name="estimatedTotalSeconds"></param> void discFormatErase_Update([In, MarshalAs(UnmanagedType.IDispatch)] object sender, int elapsedSeconds, int estimatedTotalSeconds) { IDiscFormat2Erase discFormat2Data = (IDiscFormat2Erase)sender; int percent = elapsedSeconds * 100 / estimatedTotalSeconds; // // Report back to the UI // backgroundFormatWorker.ReportProgress(percent); }