/// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            using (var grid = new GridSource(Input))
            {
                RasterColorScheme rcs = null;

                if (UseBuiltInColorScheme)
                {
                    rcs = grid.RetrieveColorScheme(GridSchemeRetrieval.Auto);
                    if (rcs == null)
                    {
                        Log.Error("No predefined color scheme was found.", null);
                        return(false);
                    }
                }
                else
                {
                    rcs = grid.GenerateColorScheme(GridSchemeGeneration.Gradient, ColorScheme);
                }

                MapConfig.GridProxyFormat = ProxyFormat;

                Output.Result = grid.CreateImageProxy(rcs);
            }

            return(Output.Result != null);
        }
Example #2
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            string options = GetOptions();

            options += StringHelper.Join(Filenames, " ");

            return(GdalUtils.Instance.GdalBuildVrt(Output.Filename, options));
        }
Example #3
0
        public ITaskInfo SendRequest(string serverCode, ITaskInfo taskInfo)
        {
            ITaskHandle taskHandle = TaskHandleFactory.CreateTaskHandle(taskInfo);

            if (taskHandle != null)
            {
                return(taskHandle.Handle(serverCode, taskInfo));
            }
            return(null);
        }
Example #4
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            // ReSharper disable once InvertIf
            if (Output.Overwrite && !GeoSource.Remove(Output.Filename))
            {
                Log.Warn("Failed to remove file: " + Output.Filename, null);
                return(false);
            }

            return(GisUtils.Instance.Polygonize(GridFilename, Output.Filename, BandIndex, false, null, GdalFormats.Shapefile));
        }
Example #5
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            var result = Input.Datasource.Merge(Input.SelectedOnly, Input2.Datasource, Input2.SelectedOnly);

            Log.Info("Number of features in the first input: " + Input.Datasource.NumFeatures);
            Log.Info("Number of features in the second input: " + Input2.Datasource.NumFeatures);
            Log.Info("Number of features in output: " + result);

            Output.Result = result;
            return(true);
        }
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            var units     = Input.Datasource.GetLengthUnits();
            var tolerance = UnitConversionHelper.Convert(Tolerance.Units, units, Tolerance.Value);

            Log.Info("Tolerance in datasource units: {0} {1}", tolerance, units.EnumToString());

            var fs = Input.Datasource.SimplifyLines(tolerance, Input.SelectedOnly);

            Output.Result = fs;

            return(true);
        }
Example #7
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            // implement the run part as well, although it won't be called from UI,
            // to make the core MapWinGIS method testable
            if (Input.Datasource.SelectByShapefile(Input2.Datasource, Relation, Input2.SelectedOnly, out var result))
            {
                Log.Info("Number of features selected: " + result.Length);
            }
            else
            {
                Log.Info("No features are selected.");
            }

            return(true);
        }
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            var g  = Extents.ToGeometry();
            var fs = new FeatureSet(GeometryType.Polygon);

            fs.Features.EditAdd(g);

            var result = Input.Datasource.Clip(Input.SelectedOnly, fs, false);

            if (result != null)
            {
                Log.Info("Number of output features: " + result.NumFeatures);
            }

            Output.Result = result;
            return(true);
        }
Example #9
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            bool result = GdalUtils.Instance.TranslateRaster(InputFilename, Output.Filename, Options);

            if (!result)
            {
                Log.Error(@"The process did not finish successfully.", null);
                return(false);
            }

            if (!File.Exists(Output.Filename))
            {
                Log.Info(@"The process did finish successfully. But the resulting file was not created.");
                return(false);
            }

            return(true);
        }
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            var  fs      = Input.Datasource;
            bool editing = fs.EditingTable;

            if (!editing)
            {
                fs.StartEditingTable();
            }

            bool result = false;

            try
            {
                if (!fs.Fields.Exists(FieldName))
                {
                    fs.Fields.Add(new AttributeField()
                    {
                        Name  = FieldName,
                        Type  = AttributeType.Double,
                        Alias = FieldName + ", " + UnitsHelper.GetAbbreviatedName(Units)
                    });
                }

                result = Calcualte(task);
            }
            catch (Exception ex)
            {
                if (!editing)
                {
                    fs.StopEditingTable(false);
                }

                throw;
            }

            if (!editing)
            {
                fs.StopEditingTable();
            }

            return(result);
        }
Example #11
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            var grid = new GridSource(GridFilename);

            bool result;

            try
            {
                result = GisUtils.Instance.GridStatisticsToShapefile(grid, Vector.Datasource, Vector.SelectedOnly,
                                                                     OverwriteFields);
            }
            catch (Exception)
            {
                grid.Dispose();
                throw;
            }

            return(result);
        }
Example #12
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            var poly = GetPolygon();

            if (poly == null)
            {
                Log.Warn("Failed to extract the clip polygon.", null);
                return(false);
            }

            // ReSharper disable once InvertIf
            if (Output.Overwrite && !GeoSource.Remove(Output.Filename))
            {
                Log.Warn("Failed to remove file: " + Output.Filename, null);
                return(false);
            }

            return(GisUtils.Instance.ClipGridWithPolygon(Input.Datasource.Filename, poly, Output.Filename, KeepExtents));
        }
Example #13
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            bool success;

            if (Output.MemoryLayer)
            {
                Output.Result = Input.Datasource.FixUpShapes(Input.SelectedOnly);
                success       = true;
            }
            else
            {
                success = GisUtils.Instance.FixUpShapes(Input.Datasource, Input.SelectedOnly, Output.Filename, Output.Overwrite);
            }

            if (!success)
            {
                Log.Info("Failed to fix shapefile.");
            }

            return(success);
        }
Example #14
0
        /// <summary>
        /// Provide execution logic for the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            var units = Input.Datasource.GetLengthUnits();

            var bufferDistance = UnitConversionHelper.Convert(BufferDistance.Units, units, BufferDistance.Value);

            var success = false;

            if (Output.MemoryLayer)
            {
                Output.Result = Input.Datasource.BufferByDistance(bufferDistance, NumSegments, Input.SelectedOnly,
                                                                  MergeResults);
            }
            else
            {
                success = GisUtils.Instance.BufferByDistance(Input.Datasource, Input.SelectedOnly, bufferDistance,
                                                             NumSegments, MergeResults, Output.Filename, Output.Overwrite);
            }

            return(Output.Result != null || success);
        }
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            var errors = GetErrors(Input.Datasource, task).ToList();

            _errorCount = errors.Count;

            if (CreateOutput && errors.Any())
            {
                CreateOutputDatasource(errors);

                Log.Info("------------------------");
                Log.Info("Number of invalid geometries: " + errors.Count);
            }

            if (!errors.Any())
            {
                Log.Info("No invalid geometries were found.");
            }

            return(true);
        }
        /// <summary>
        /// Performs the main calculation.
        /// </summary>
        private bool Calcualte(ITaskHandle task)
        {
            var fs = GetWgs84FeatureSet();

            if (fs == null)
            {
                string proj = Input.Datasource.Projection.ExportToProj4();
                Log.Warn("Failed to reproject datasource to WGS84: {0}", null, proj);
                return(false);
            }

            var features = fs.GetFeatures(Input.SelectedOnly);

            int lastPercent = 0;

            var table      = Input.Datasource.Table;
            int fieldIndex = table.Fields.IndexByName(FieldName);

            for (int i = 0; i < features.Count; i++)
            {
                task.CheckPauseAndCancel();
                task.Progress.TryUpdate("Calculating...", i, features.Count, ref lastPercent);

                var ft = features[i];

                double area = GeodesicUtils.GeodesicArea(ft.Geometry);

                area = UnitConversionHelper.Convert(AreaUnits.SquareMeters, Units, area);

                table.EditCellValue(fieldIndex, ft.Index, area);
            }

            if (fs.InternalObject != Input.Datasource.InternalObject)
            {
                // it's a reprojected one
                fs.Dispose();
            }

            return(true);
        }
Example #17
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        /// <returns>True on success, which closes the view</returns>
        public override bool Run(ITaskHandle task)
        {
            Log.Debug("Creating {0} random points", NumPoints);

            var extents = InputLayer.Datasource.Envelope;

            var fs = new FeatureSet(GeometryType.Point);

            fs.Projection.CopyFrom(InputLayer.Datasource.Projection);

            var vector = InputLayer as IVectorInput;

            if (vector != null && vector.SelectedOnly)
            {
                // Get the extent, taking into account selected shapes:
                extents = vector.Datasource.GetSelectedExtents();
            }

            var random      = new Random();
            var lastPercent = 0;

            for (int i = 0; i < NumPoints; i++)
            {
                task.CheckPauseAndCancel();
                var x       = extents.MinX + (extents.Width * random.NextDouble());
                var y       = extents.MinY + (extents.Height * random.NextDouble());
                var feature = new Geometry(GeometryType.Point);
                feature.Points.Add(new Coordinate(x, y));
                fs.Features.EditAdd(feature);

                task.Progress.TryUpdate("Running...", i, NumPoints, ref lastPercent);
            }

            task.Progress.Clear();
            Log.Debug("New feature set has {0} features", fs.NumFeatures);

            OutputLayer.Result = fs;

            return(true);
        }
Example #18
0
        private ICompletion CompleteOperation(bool wasSynchronous)
        {
            Debug.Assert(_operationType != OperationType.None, "CompleteOperation called when _operationType was None.");

            try
            {
                if (_timeoutHandle != null && !_timeoutHandle.TrySetComplete())
                {
                    SetError(SocketError.TimedOut);
                }
                _timeoutHandle = null;

                if (_operationType == OperationType.OneWay && _oneWayResultAction != null)
                {
                    return(OneWayAsyncEventArgs.Create(wasSynchronous, _error, _oneWayResultAction));
                }

                if (_operationType == OperationType.RoundTrip && _roundTripResultAction != null)
                {
                    if (_error == null)
                    {
                        var result = RoundTripAsyncEventArgs.Create(wasSynchronous, null, _responseData, _roundTripResultAction);
                        // don't want _responseData to be returned to the pool
                        // before the consumer has a chance to read it. It will
                        // be disposed when result.Complete() is called.
                        _responseData = null;
                        return(result);
                    }
                    else
                    {
                        return(RoundTripAsyncEventArgs.Create(wasSynchronous, _error, null, _roundTripResultAction));
                    }
                }
                return(null);
            }
            finally
            {
                Reset();
            }
        }
Example #19
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            bool success = false;

            if (Output.MemoryLayer)
            {
                var fs = Input.Datasource.ExportSelection();

                if (fs != null)
                {
                    Log.Info("Number of features exported: " + fs.NumFeatures);
                }

                Output.Result = fs;
            }
            else
            {
                success = GisUtils.Instance.ExportSelection(Input.Datasource, Output.Filename, Output.Overwrite);
            }

            return(Output.Result != null || success);
        }
        /// <summary>
        /// Validates shapes and returns list of errors.
        /// </summary>
        private IEnumerable <ErrorInfo> GetErrors(IFeatureSet fs, ITaskHandle task)
        {
            int lastPercent = 0;

            for (int i = 0; i < fs.NumFeatures; i++)
            {
                task.CheckPauseAndCancel();
                task.Progress.TryUpdate("Calculating...", i, fs.NumFeatures, ref lastPercent);

                var gm = fs.Features[i].Geometry;
                if (!gm.IsValid)
                {
                    var info = ValidationHelper.GetErrorInfo(fs, i, gm.IsValidReason);

                    Log.Info(info.Message);

                    yield return(info);
                }
            }

            task.Progress.Clear();
        }
        public void TaskExecution()
        {
            const int ActionCount = 100000;
            var container = BuildContainer();
            var taskWorkerFactory = container.Resolve<TaskWorkerFactory>();
            using(var taskWorker = taskWorkerFactory(ApartmentState.MTA)) {
                taskWorker.Start();

                long averageRunTime = PerformanceTestRunner.ExecuteAction(
                    25,
                    () => {
                        ITaskHandle[] taskHandles = new ITaskHandle[ActionCount];
                        for (int i = 0; i < ActionCount; i++) {
                            taskHandles[i] = taskWorker.ExecuteAction(() => {	});
                        }

                        TaskHandle.WaitAll(taskHandles);
                    });

                Console.WriteLine("TaskExecution Mean Runtime: {0}ms", averageRunTime);
            }
        }
Example #22
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            bool success = false;

            if (Output.MemoryLayer)
            {
                var fs = Input.Datasource.ExplodeShapes(Input.SelectedOnly);

                if (fs != null)
                {
                    Log.Info("Initial number of features: " + Input.Datasource.NumFeatures);
                    Log.Info("After exploding: " + fs.NumFeatures);
                }

                Output.Result = fs;
            }
            else
            {
                success = GisUtils.Instance.ExplodeShapes(Input.Datasource, Input.SelectedOnly, Output.Filename, Output.Overwrite);
            }

            return(Output.Result != null || success);
        }
Example #23
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            string options = GetOptions();

            bool result = GdalUtils.Instance.WarpRaster(InputFilename, Output.Filename, options);

            if (!result)
            {
                string s = string.Format("Failed to reprojected raster datasource {0}. Options: {1}", InputFilename, options);
                Log.Error(s, null);
                return(false);
            }

            if (!File.Exists(Output.Filename))
            {
                Log.Info(@"The process did finish successfully. But the resulting file was not created.");
                return(false);
            }

            Log.Info("Raster datasource was reprojected: " + Output.Filename);

            return(true);
        }
Example #24
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            var fs = Input.Datasource;

            var fsNew = fs.Clone(fs.GeometryType);

            if (!TrySaveForAppendMode(Output, fsNew))
            {
                return(false);
            }

            var lastPercent = 0;

            var features = Input.Datasource.GetFeatures(Input.SelectedOnly);

            for (var i = 0; i < features.Count; i++)
            {
                task.CheckPauseAndCancel();
                task.Progress.TryUpdate("Calculating...", i, features.Count, ref lastPercent);

                var ft = features[i];

                var gm         = ft.Geometry.Clone(fs.GeometryType);
                var shapeIndex = fsNew.Features.EditAdd(gm);

                if (shapeIndex != -1)
                {
                    fs.Table.CopyAttributes(ft.Index, fsNew.Table, shapeIndex);
                }
            }

            task.Progress.Clear();

            Output.Result = fsNew;

            return(true);
        }
Example #25
0
        private IEnumerator <bool> GetSendEnumerator(
            int timeout,
            IPoolItem <MemoryStream> sendData,
            OperationType type,
            Delegate resultAction,
            ParameterlessDelegate callback)
        {
            ValidateSocketForUse();

            _sendData      = sendData;
            _operationType = type;
            if (_operationType == OperationType.OneWay)
            {
                _oneWayResultAction = (Action <OneWayAsyncEventArgs>)resultAction;
            }
            else if (_operationType == OperationType.RoundTrip)
            {
                _roundTripResultAction = (Action <RoundTripAsyncEventArgs>)resultAction;
                _responseData          = AsyncSocketClient.MemoryPool.Borrow();
            }
            else
            {
                string message = string.Format("Unexpected operation type '{0}'", type);
                Debug.Fail(message);
                SetError(new InvalidOperationException(message));
                yield break;
            }

            _socketArgs.UserToken = callback;

            if (_state == State.Uninitialized)
            {
                LogDebugStep("Connecting...");
                _state = State.Connecting;
                var connectTimeoutHandle = TaskMonitor.RegisterMonitor(_connectTimeout, _timeoutHandler, null);
                if (_socket.ConnectAsync(_socketArgs))
                {
                    yield return(false);
                }
                if (!connectTimeoutHandle.TrySetComplete())
                {
                    LogDebugStep("Failed to set connection timeout handle complete.");
                    SetError(SocketError.TimedOut);
                    yield break;
                }
                if (!ValidateCompletedEvent(_socketArgs, SocketAsyncOperation.Connect))
                {
                    yield break;
                }

                _state = State.Connected;
                LogDebugStep("Connected.");

                ThreadPool.UnsafeQueueUserWorkItem(o =>
                {
                    var target = (SocketChannel)o;
                    var task   = new AsyncSocketTask(this);
                    task.SetEnumerator(target.GetReceiveEnumerator(task.Callback));
                    task.Execute(false);
                }, this);
            }

            Debug.Assert(_sendData != null, "_sendData was not set prior to starting the send enumerator.");
            _socketArgs.SetBuffer(_sendData.Item.GetBuffer(), (int)_sendData.Item.Position, (int)_sendData.Item.Length);
            _timeoutHandle = TaskMonitor.RegisterMonitor(timeout, _timeoutHandler, null);
            // note - it seems this is necessary because of a bug in the SendAsync function
            // see - http://social.msdn.microsoft.com/Forums/en-IE/ncl/thread/40fe397c-b1da-428e-a355-ee5a6b0b4d2c
            Thread.MemoryBarrier();
            if (_log.IsDebugEnabled)
            {
                LogDebugStep(string.Format("Sending {0:###,###,###,##0} bytes", _sendData.Item.Length - _sendData.Item.Position));
            }
            if (_socket.SendAsync(_socketArgs))
            {
                yield return(false);
            }
            if (!ValidateCompletedEvent(_socketArgs, SocketAsyncOperation.Send))
            {
                yield break;
            }

            _messageSent = true;
        }
Example #26
0
        private IEnumerator <bool> GetSendEnumerator(
            int timeout,
            IPoolItem <MemoryStream> sendData,
            OperationType type,
            Delegate resultAction,
            ParameterlessDelegate callback)
        {
            ValidateSocketForUse();

            _sendData      = sendData;
            _operationType = type;
            if (_operationType == OperationType.OneWay)
            {
                _oneWayResultAction = (Action <OneWayAsyncEventArgs>)resultAction;
            }
            else if (_operationType == OperationType.RoundTrip)
            {
                _roundTripResultAction = (Action <RoundTripAsyncEventArgs>)resultAction;
                _responseData          = AsyncSocketClient.MemoryPool.Borrow();
            }
            else
            {
                string message = string.Format("Unexpected operation type '{0}'", type);
                Debug.Fail(message);
                SetError(new InvalidOperationException(message));
                yield break;
            }

            _socketArgs.UserToken = callback;

            if (_state == State.Uninitialized)
            {
                _state = State.Connecting;
                var connectTimeoutHandle = TaskMonitor.RegisterMonitor(_connectTimeout, _timeoutHandler, null);
                if (_socket.ConnectAsync(_socketArgs))
                {
                    yield return(false);
                }
                if (!connectTimeoutHandle.TrySetComplete())
                {
                    SetError(SocketError.TimedOut);
                    yield break;
                }
                if (!ValidateCompletedEvent(_socketArgs, SocketAsyncOperation.Connect))
                {
                    yield break;
                }

                _state = State.Connected;

                ThreadPool.UnsafeQueueUserWorkItem(o =>
                {
                    var target = (SocketChannel)o;
                    var task   = new AsyncSocketTask(this);
                    task.SetEnumerator(target.GetReceiveEnumerator(task.Callback));
                    task.Execute(false);
                }, this);
            }

            Debug.Assert(_sendData != null, "_sendData was not set prior to starting the send enumerator.");
            _socketArgs.SetBuffer(_sendData.Item.GetBuffer(), (int)_sendData.Item.Position, (int)_sendData.Item.Length);
            _timeoutHandle = TaskMonitor.RegisterMonitor(timeout, _timeoutHandler, null);
            if (_socket.SendAsync(_socketArgs))
            {
                yield return(false);
            }
            if (!ValidateCompletedEvent(_socketArgs, SocketAsyncOperation.Send))
            {
                yield break;
            }

            _messageSent = true;
        }
 /// <summary>
 /// Provide execution logic for the tool.
 /// </summary>
 public override bool Run(ITaskHandle task)
 {
     return(true);
 }
 /// <summary>
 /// Runs the tool.
 /// </summary>
 public override bool Run(ITaskHandle task)
 {
     Output.Result = Input.Datasource.Sort(FieldIndex, Ascending);
     return(true);
 }
		private IEnumerator<bool> GetSendEnumerator(
			int timeout,
			IPoolItem<MemoryStream> sendData,
			OperationType type,
			Delegate resultAction,
			ParameterlessDelegate callback)
		{
			ValidateSocketForUse();

			_sendData = sendData;
			_operationType = type;
			if (_operationType == OperationType.OneWay)
			{
				_oneWayResultAction = (Action<OneWayAsyncEventArgs>)resultAction;
			}
			else if (_operationType == OperationType.RoundTrip)
			{
				_roundTripResultAction = (Action<RoundTripAsyncEventArgs>)resultAction;
				_responseData = AsyncSocketClient.MemoryPool.Borrow();
			}
			else
			{
				string message = string.Format("Unexpected operation type '{0}'", type);
				Debug.Fail(message);
				SetError(new InvalidOperationException(message));
				yield break;
			}

			_socketArgs.UserToken = callback;

			if (_state == State.Uninitialized)
			{
				_state = State.Connecting;
				var connectTimeoutHandle = TaskMonitor.RegisterMonitor(_connectTimeout, _timeoutHandler, null);
				if (_socket.ConnectAsync(_socketArgs)) yield return false;
				if (!connectTimeoutHandle.TrySetComplete())
				{
					SetError(SocketError.TimedOut);
					yield break;
				}
				if (!ValidateCompletedEvent(_socketArgs, SocketAsyncOperation.Connect)) yield break;

				_state = State.Connected;

				ThreadPool.UnsafeQueueUserWorkItem(o =>
				{
					var target = (SocketChannel)o;
					var task = new AsyncSocketTask(this);
					task.SetEnumerator(target.GetReceiveEnumerator(task.Callback));
					task.Execute(false);
				}, this);
			}

			Debug.Assert(_sendData != null, "_sendData was not set prior to starting the send enumerator.");
			_socketArgs.SetBuffer(_sendData.Item.GetBuffer(), (int)_sendData.Item.Position, (int)_sendData.Item.Length);
			_timeoutHandle = TaskMonitor.RegisterMonitor(timeout, _timeoutHandler, null);
			if (_socket.SendAsync(_socketArgs)) yield return false;
			if (!ValidateCompletedEvent(_socketArgs, SocketAsyncOperation.Send)) yield break;

			_messageSent = true;
		}
		private ICompletion CompleteOperation(bool wasSynchronous)
		{
			Debug.Assert(_operationType != OperationType.None, "CompleteOperation called when _operationType was None.");

			try
			{
				if (_timeoutHandle != null && !_timeoutHandle.TrySetComplete())
				{
					SetError(SocketError.TimedOut);
				}
				_timeoutHandle = null;

				if (_operationType == OperationType.OneWay && _oneWayResultAction != null)
				{
					return OneWayAsyncEventArgs.Create(wasSynchronous, _error, _oneWayResultAction);
				}

				if (_operationType == OperationType.RoundTrip && _roundTripResultAction != null)
				{
					if (_error == null)
					{
						var result = RoundTripAsyncEventArgs.Create(wasSynchronous, null, _responseData, _roundTripResultAction);
						// don't want _responseData to be returned to the pool
						// before the consumer has a chance to read it. It will
						// be disposed when result.Complete() is called.
						_responseData = null;
						return result;
					}
					else
					{
						return RoundTripAsyncEventArgs.Create(wasSynchronous, _error, null, _roundTripResultAction);
					}
				}
				return null;
			}
			finally
			{
				Reset();
			}
		}
Example #31
0
 public LoadingTile(ITaskHandle taskHandle, Tile tile)
 {
     this.taskHandle = taskHandle;
     this.tile = tile;
 }
Example #32
0
 /// <summary>
 /// Runs the tool.
 /// </summary>
 public override bool Run(ITaskHandle task)
 {
     Log.Info("Custom tool is running");
     return(true);
 }
Example #33
0
 /// <summary>
 /// Runs the tool.
 /// </summary>
 public abstract bool Run(ITaskHandle task);
Example #34
0
        /// <summary>
        /// Runs the tool.
        /// </summary>
        public override bool Run(ITaskHandle task)
        {
            var options = GetOptions();

            return(GdalUtils.Instance.GdalAddOverviews(InputFilename, options, Levels));
        }