WriteableBitmap.TryLock Method (Duration)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Attempts to lock the bitmap, waiting for no longer than the specified length of time.

Namespace:   System.Windows.Media.Imaging
Assembly:  PresentationCore (in PresentationCore.dll)

[SecurityCriticalAttribute]
public bool TryLock(
	Duration timeout
)

Parameters

timeout
Type: System.Windows.Duration

A Duration that represents the length of time to wait. A value of 0 returns immediately. A value of Forever blocks indefinitely.

Return Value

Type: System.Boolean

true if the lock was acquired; otherwise, false.

Exception Condition
ArgumentOutOfRangeException

timeout is set to Automatic.

When a lock is acquired, the behavior of the TryLock method is the same as the Lock method.

SecurityPermission

for access to unmanaged resources. Security action: Demand. Associated enumeration: SecurityPermissionFlag.UnmanagedCode

.NET Framework
Available since 3.0
Return to top
Show: