Skip to main content

RepositoryItemMRUEdit.SaveItemsToStream(Stream) Method

Saves items from the RepositoryItemMRUEdit.Items collection to a stream.

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.1.dll

NuGet Package: DevExpress.Win.Navigation

Declaration

public void SaveItemsToStream(
    Stream stream
)

Parameters

Name Type Description
stream Stream

A stream to which data is saved.

Remarks

To load data saved by the SaveItemsToStream method, use the RepositoryItemMRUEdit.LoadItemsFromStream method.

Note

If you want to save items to and load them from a MemoryStream, use the DevExpress.XtraEditors.Controls.MRUMemoryStream class instead. To close the MRUMemoryStream after you finish working with it, call the MRUMemoryStream.CloseStream method. Do not use the MRUMemoryStream.Close method, as this method is overridden and does nothing. Do not use the MemoryStream with the SaveItemsToStream method, as the MemoryStream will be immediately closed after you call the SaveItemsToStream method.

The following code shows how to save items to a MRUMemoryStream and then load items back. After items are loaded, the stream is destroyed.

using DevExpress.XtraEditors.Controls;

MRUMemoryStream s = new MRUMemoryStream();
mEdit1.Properties.SaveItemsToStream(s);
//...
mEdit1.Properties.LoadItemsFromStream(s);
s.CloseStream();
See Also