AvalonEdit
SetOwnerThread Method (newOwner)
NamespacesICSharpCode.AvalonEdit.DocumentTextDocumentSetOwnerThread(Thread)
Transfers ownership of the document to another thread. This method can be used to load a file into a TextDocument on a background thread and then transfer ownership to the UI thread for displaying the document.
Declaration Syntax
C#Visual BasicVisual C++
public void SetOwnerThread(
	Thread newOwner
)
Public Sub SetOwnerThread ( _
	newOwner As Thread _
)
public:
void SetOwnerThread(
	Thread^ newOwner
)
Parameters
newOwner (Thread)
Remarks

The TextDocument class is not thread-safe. A document instance expects to have a single owner thread and will throw an InvalidOperationException when accessed from another thread. It is possible to change the owner thread using the SetOwnerThread(Thread) method.

The owner can be set to null, which means that no thread can access the document. But, if the document has no owner thread, any thread may take ownership by calling SetOwnerThread(Thread).

Assembly: ICSharpCode.AvalonEdit (Module: ICSharpCode.AvalonEdit.dll) Version: 5.0.0.4238