windowsforms-devexpress-dot-utils-dot-workspacemanager-413942bc.md
Gets or sets whether this WorkspaceManager should automatically close streams opened when loading workspaces.
Namespace : DevExpress.Utils
Assembly : DevExpress.Utils.v25.2.dll
NuGet Packages : DevExpress.Utils, DevExpress.Wpf.Core
[DefaultValue(DefaultBoolean.Default)]
[DXCategory("Behavior")]
public DefaultBoolean CloseStreamOnWorkspaceLoading { get; set; }
<DXCategory("Behavior")>
<DefaultValue(DefaultBoolean.Default)>
Public Property CloseStreamOnWorkspaceLoading As DefaultBoolean
| Type | Default | Description |
|---|---|---|
| DefaultBoolean | Default |
A DefaultBoolean enumerator value that specifies whether this WorkspaceManager should automatically close streams opened when loading workspaces.
|
Available values:
| Name | Description | Return Value |
|---|---|---|
| True |
The value is true.
|
0
| | False |
The value is false.
|
1
| | Default |
The value is specified by a global option or a higher-level object.
|
2
|
Each time the WorkspaceManager saves (WorkspaceManager.SaveWorkspace) or loads (WorkspaceManager.LoadWorkspace) a workspace, it opens a stream to work with an XML file. By default, these streams are not closed automatically and stay in memory, which can cause performance issues when working with large workspaces. To force the WorkspaceManager to close these streams, set the CloseStreamOnWorkspaceLoading and WorkspaceManager.CloseStreamOnWorkspaceSaving properties to DefaultBoolean.True.
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the CloseStreamOnWorkspaceLoading property.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.
winforms-workspacemanager-saving-load-app-layout/CS/T190543/Form1.cs#L43
this.workspaceManager1.CloseStreamOnWorkspaceSaving = DevExpress.Utils.DefaultBoolean.True;
this.workspaceManager1.CloseStreamOnWorkspaceLoading = DevExpress.Utils.DefaultBoolean.True;
this.workspaceManager1.CaptureWorkspace("Default");
winforms-workspacemanager-saving-load-app-layout/VB/T190543/Form1.vb#L42
workspaceManager1.CloseStreamOnWorkspaceSaving = DevExpress.Utils.DefaultBoolean.True
workspaceManager1.CloseStreamOnWorkspaceLoading = DevExpress.Utils.DefaultBoolean.True
workspaceManager1.CaptureWorkspace("Default")
See Also