C# Class SuperMap.WinRT.Mapping.ExecutantPool

最终请求图片的地方,通过SemaphoreSlim限制同时请求的数量,当打到上限后,阻塞线程。 设置缓冲区,可以缓村需要请求图片的Tile。
Inheritance: IDisposable
Mostrar archivo Open project: SuperMap/iClient-for-Win8 Class Usage Examples

Public Methods

Method Description
AddTiles ( IList tiles ) : void

向线程池中加入待请求的tile。此tile会先进入队列中进行等待,直到有空闲的线程,才会开始请求。

CancelByLayerId ( string layerId ) : void

通过图层id清除正在请求的Tile,此处设计不太合理,下回修改吧……

Clear ( string id ) : void

从队列中移除掉指定图层的Tile。 逻辑还不太清晰,与CancelByLayerId的关系。

Dispose ( ) : void

释放占用的资源,清空所有的请求。

ExecutantPool ( int count ) : System
IsDownloading ( string key ) : bool
Register ( string id ) : void
Unregiest ( string id ) : void

Private Methods

Method Description
DownloadImage ( Tile tile ) : Task

开始请求图片

OnDownloadImageCompleted ( Tile tile ) : void
Start ( ) : void

从队列中获取Tile,并请求图片。

Method Details

AddTiles() public method

向线程池中加入待请求的tile。此tile会先进入队列中进行等待,直到有空闲的线程,才会开始请求。
public AddTiles ( IList tiles ) : void
tiles IList
return void

CancelByLayerId() public method

通过图层id清除正在请求的Tile,此处设计不太合理,下回修改吧……
public CancelByLayerId ( string layerId ) : void
layerId string
return void

Clear() public method

从队列中移除掉指定图层的Tile。 逻辑还不太清晰,与CancelByLayerId的关系。
public Clear ( string id ) : void
id string
return void

Dispose() public method

释放占用的资源,清空所有的请求。
public Dispose ( ) : void
return void

ExecutantPool() public method

public ExecutantPool ( int count ) : System
count int
return System

IsDownloading() public method

public IsDownloading ( string key ) : bool
key string
return bool

Register() public method

public Register ( string id ) : void
id string
return void

Unregiest() public method

public Unregiest ( string id ) : void
id string
return void