Micro Focus Content Manager SDK 9.4
|
The WgsProgressNotifier class provides a mechanism for SDK applications to receive progress updates while the SDK is communicating with a workgroup server. It also allows SDK applications to cancel ongoing operations. More...
Public Member Functions | |
WgsProgressNotifier (Database db) | |
delegate void | OnWgsProgressEventHandler (WgsProgressInfo wgsProgressInfo) |
Public Member Functions inherited from HP.HPTRIM.SDK.WgsProgressNotifierBase | |
void | Dispose () |
WgsProgressNotifierBase (Database db) | |
delegate void | SwigDelegateWgsProgressNotifierBase_0 (global::System.IntPtr args) |
Events | |
OnWgsProgressEventHandler | OnWgsProgress |
The WgsProgressNotifier class provides a mechanism for SDK applications to receive progress updates while the SDK is communicating with a workgroup server. It also allows SDK applications to cancel ongoing operations.
When a WgsProgressNotifier is constructed, it is associated with a Database instance, and when the Database instance is interacting with a workgroup server, WgsProgressNotifier will periodically call a user-specified event (WgsProgressNotifier.OnWgsProgress), with information about the currently executing operation (see the WgsProgressInfo class).
It is possible for the application to cancel ongoing workgroup server operations, by setting WgsProgressInfo.ShouldCancel to true.
The following is a simple example of how to use WgsProgressNotifier.
private void Notifier_OnWgsProgress(WgsProgressInfo progressInfo) { if (progressInfo.WgsMethod != "") { System.Console.WriteLine("Calling WGS method: " + progressInfo.WgsMethod); System.Console.WriteLine("Elapsed time for current operation (ms): " + progressInfo.WgsMethodElapsedMs); } if (progressInfo.IsDownloadingFile || progressInfo.IsUploadingFile) { string msg = String.Format( "Transferring {0} bytes. Percentage transferred so far: {1}", progressInfo.FileTransferTotalSize, progressInfo.FileTransferPerCentCompleted); System.Console.WriteLine(msg); } // Cancel any operation that takes more than a minute. if (progressInfo.WgsMethodElapsedMs > 60*1000) { progressInfo.ShouldCancel = true; } } using (WgsProgressNotifier notifier = new WgsProgressNotifier(db)) { notifier.OnWgsProgress += Notifier_OnWgsProgress; Record rec = new Record(db, "Some Record"); string downloadTo = "C:\\Some Record.doc"; rec.GetDocument(downloadTo, false, "", ""); }
HP.HPTRIM.SDK.WgsProgressNotifier.WgsProgressNotifier | ( | Database | db | ) |
delegate void HP.HPTRIM.SDK.WgsProgressNotifier.OnWgsProgressEventHandler | ( | WgsProgressInfo | wgsProgressInfo | ) |
OnWgsProgressEventHandler HP.HPTRIM.SDK.WgsProgressNotifier.OnWgsProgress |