コード例 #1
0
        public IHgtDataCell GetCellFor(HgtCellCoords coords)
        {
            var path = _pathResolver.FindFilePath(coords);

            FileStream file = null;

            try
            {
                int fileSize = (int)new FileInfo(path).Length;
                file = File.Open(path, FileMode.Open, FileAccess.Read, FileShare.Read);
                return(new HgtDataCellInFile(file, HgtUtils.PointsPerCellFromDataLength(fileSize), coords));
            }
            catch (Exception)
            {
                if (file != null)
                {
                    file.Dispose();
                }
                throw;
            }
        }
コード例 #2
0
        public async Task <IHgtDataCell> GetCellForAsync(HgtCellCoords coords)
        {
            var data = await _loader.LoadFromFileAsync(coords);

            return(new HgtDataCellInMemory(data, HgtUtils.PointsPerCellFromDataLength(data.Length), coords));
        }
コード例 #3
0
        public IHgtDataCell GetCellFor(HgtCellCoords coords)
        {
            var data = _loader.LoadFromFile(coords);

            return(new HgtDataCellInMemory(data, HgtUtils.PointsPerCellFromDataLength(data.Length), coords));
        }