Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RepositoryItemMRUEdit.SaveItemsToStream(Stream) Method

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

Namespace: DevExpress.XtraEditors.Repository

Assembly: DevExpress.XtraEditors.v24.2.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