Create custom classes that inherit from NOpenCommandAction and NSaveAsCommandAction and override the GetFormats method to return only the drawing file formats you want to show in the "Open" and "Save As" file dialogs.
For example, the following custom commands will show only the Visio Drawing (VSDX) and AutoCAD Drawing Interchange (DXF) file formats:
Custom Diagram "Open" command action |
Copy Code
|
---|---|
private class CustomOpenCommandAction : NOpenCommandAction { public CustomOpenCommandAction() { } static CustomOpenCommandAction() { CustomOpenCommandActionSchema = NSchema.Create(typeof(CustomOpenCommandAction), NOpenCommandActionSchema); } protected override NDrawingFormat[] GetFormats() { return new NDrawingFormat[] { NDrawingFormat.Visio, NDrawingFormat.VectorAutoCadDxf }; } public static readonly NSchema CustomOpenCommandActionSchema; } |
Custom Diagram "Save As" command action |
Copy Code
|
---|---|
public class CustomSaveAsCommandAction : NSaveAsCommandAction { public CustomSaveAsCommandAction() { } static CustomSaveAsCommandAction() { CustomSaveAsCommandActionSchema = NSchema.Create(typeof(CustomSaveAsCommandAction), NSaveAsCommandActionSchema); } protected override NDrawingFormat[] GetFormats() { return new NDrawingFormat[] { NDrawingFormat.Visio, NDrawingFormat.VectorAutoCadDxf }; } public static readonly NSchema CustomSaveAsCommandActionSchema; } |