Example #1
0
 public NativeCallback(IGlobalListener callback)
 {
     if (callback == null)
     {
         throw new ArgumentNullException("callback");
     }
     Callback = callback;
 }
Example #2
0
 /// <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);
 }
Example #3
0
 /// <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);
 }
Example #4
0
        /// <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;
        }
Example #5
0
 /// <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;
         }
     }
 }
Example #6
0
 public static NativeCallback Wrap(IGlobalListener callback)
 {
     return(callback != null ? new NativeCallback(callback) : null);
 }