The requested page is not available for the requested platform. You are viewing the content for .NET Framework 4.5.2+ platform.
.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
.NET Core 3.0+

SaveDocumentAsCommand Class

Invokes the File dialog that prompts for a file name, and saves a document in a file with the specified name and format.

Namespace: DevExpress.XtraRichEdit.Commands

Assembly: DevExpress.RichEdit.v19.2.Core.dll

Declaration

public class SaveDocumentAsCommand :
    RichEditMenuItemSimpleCommand
Public Class SaveDocumentAsCommand
    Inherits RichEditMenuItemSimpleCommand
public class SaveDocumentAsCommand :
    RichEditMenuItemSimpleCommand
Public Class SaveDocumentAsCommand
    Inherits RichEditMenuItemSimpleCommand

Remarks

To adjust the SaveAs dialog settings or to accomplish other specific tasks you can substitute the default command with your own custom descendant.

A custom command inherits from the SaveDocumentAsCommand class and overrides the protected ExecuteCore method. To substitute a default command with a custom command, create a new command factory - the class that implements the IRichEditCommandFactoryService interface and intercepts a call that creates a SaveDocumentAsCommand command. Register the new command factory via the IRichEditDocumentServer.ReplaceService<T> method.

The technique is illustrated in the following code snippet.

using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.Export;
using DevExpress.XtraRichEdit.Services;
        public Form1() {
            InitializeComponent();

            CustomRichEditCommandFactoryService commandFactory = 
                new CustomRichEditCommandFactoryService(richEditControl1, 
                    richEditControl1.GetService<IRichEditCommandFactoryService>());
            richEditControl1.ReplaceService<IRichEditCommandFactoryService>(commandFactory);
        }

You can also use the RichEditControl.SaveDocumentAs API method to achieve the same result.

Inheritance

Object
Command
DevExpress.Utils.Commands.ControlCommand<IRichEditControl, RichEditCommandId, DevExpress.XtraRichEdit.Localization.XtraRichEditStringId>
DevExpress.XtraRichEdit.Commands.RichEditCommandBase<DevExpress.XtraRichEdit.Localization.XtraRichEditStringId>
See Also