コード例 #1
0
        private async void ProcessShapes()
        {
            this.shapeProcessingScheduled = false;
            this.reader.CancelOperation();

            var context = new ShapefileContext()
            {
                DataSourceUri = this.DataSourceUri,
                Encoding      = this.Encoding,
                SourceUri     = this.SourceUri,
                Transport     = this.TransportResolver
            };

            var collection = await this.LoadShapes(context);

            this.ChangePropertyInternally(ShapesProperty, collection);
        }
コード例 #2
0
        /// <summary>
        /// This method is exposed for testing purposes only, do not use it outside the testing project.
        /// </summary>
        internal void LoadShapesSynchronously()
        {
            var context = new ShapefileContext()
            {
                DataSourceUri = this.DataSourceUri,
                Encoding      = this.Encoding,
                SourceUri     = this.SourceUri,
                Transport     = this.TransportResolver
            };

            MapShapeModelCollection collection = null;

            Task.Run(async() =>
            {
                collection = await this.LoadShapes(context);
            }).Wait();

            this.ChangePropertyInternally(ShapesProperty, collection);
        }