public NativeCallback(IGlobalListener callback) { if (callback == null) { throw new ArgumentNullException("callback"); } Callback = callback; }
/// <summary> /// Detaches particular callback listener. /// </summary> public static bool Detach(IGlobalListener callback) { if (callback != null && _list.Contains(callback)) { _list.Remove(callback); return(true); } return(false); }
/// <summary> /// Attaches particular callback listener. /// </summary> public static bool Attach(IGlobalListener callback) { if (callback != null && !_list.Contains(callback)) { _list.Add(callback); return(true); } return(false); }
/// <summary> /// Initializes a new instance of the <see cref="TaskHandle"/> class. /// </summary> public TaskHandle(ITaskProgress progress, CancellationToken cancellationToken, WaitHandle pauseHandle, IGlobalListener callback) { if (progress == null) { throw new ArgumentNullException("progress"); } if (pauseHandle == null) { throw new ArgumentNullException("pauseHandle"); } if (callback == null) { throw new ArgumentNullException("callback"); } Callback = callback; PauseHandle = pauseHandle; Progress = progress; _cancellationToken = cancellationToken; }
/// <summary> /// Sets callback to the input datasource to provide IStopExecution implementation /// for MapWinGIS methods. /// </summary> public static void SetCallbackToInputs(this IEnumerable <BaseParameter> parameters, IGlobalListener callback) { foreach (var p in parameters.OfType <LayerParameterBase>()) { var ds = p.Datasource; if (ds != null) { ds.Callback = callback; } } }
public static NativeCallback Wrap(IGlobalListener callback) { return(callback != null ? new NativeCallback(callback) : null); }