Gets an object that can be used to synchronize access to a TileLayer.


Namespace: AspMap.Web
Assembly: AspMapNET (in AspMapNET.dll)

Syntax

Visual Basic (Declaration)
Public Shared ReadOnly Property SyncRoot As Object
C#
public static object SyncRoot { get; }
C++
public static property object SyncRoot {
    Object get();
}
J#
/** property */
public object get_SyncRoot();
JScript
public function get SyncRoot() : Object

Remarks

While instances of the TileLayer class are thread-safe, initializing a TileLayer is a multi-step process. This property can be used to prevent other threads from accessing the TileLayer before it is fully initialized.

Example

 Copy Code
TileLayer tileLayer = TileLayer.Create("id");

if (tileLayer == null)
{
    tileLayer = TileLayer.Find("id");
    map1.AddLayer(tileLayer);
    return;
}

lock (TileLayer.SyncRoot)
{
    tileLayer.TileSize = new Size(256, 256);
    ...
    tileLayer.Initialize(2);
}
map1.AddLayer(tileLayer);

See Also