02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

PetrelLogger Class<br />

range defined and the percentage done is computed for you and displayed in the progress<br />

bar.<br />

public sealed class PetrelLogger : CoreLogger<br />

{<br />

static IProgress NewProgress(int min, int max);<br />

static IProgress NewProgress(int min, int max,<br />

ProgressType t, Cursor c);<br />

...<br />

}<br />

public enum ProgressType<br />

{<br />

}<br />

Default,<br />

Cancelable<br />

The progress type (whether the operation is cancellable by the user) and what cursor you<br />

would like displayed while the progress status is between min and max are optional; use<br />

the other NewProgress method to set these properties.<br />

public interface IProgress : IDisposable<br />

{<br />

bool IsCancelable { get; }<br />

bool IsCanceled { get; }<br />

Cursor Cursor { get; }<br />

int ProgressStatus { get; set; }<br />

string ProgressText { set; }<br />

}<br />

If the operation is cancellable (ProgressType.Cancelable), there is an abort button<br />

displayed automatically in the status bar. The cursor provides a visual cue that processing<br />

is being performed but does not block selection of the abort button. The icon next to the<br />

progress bar is always an hourglass.<br />

Fig. 5-12Progress Bar<br />

The progress bar is updated via IProgress.ProgressStatus; this value should be<br />

between the min and max and will be converted to a percentage. Use the IsCanceled<br />

<strong>Schlumberger</strong> Private<br />

Petrel Convenience Classes 5-251

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!