You need to derive your plugin class from FileType or PropertyBasedFileType or FileType<TToken, TTWidget> and implement IFileTypeFactory or IFileTypeFactory2 (newer, recommended) interfaces.
Derive from FileType if you don't need to show any settings on Save dialog,
Derive from PropertyBasedFileType if you need to show settings on Save dialog using paint.net's internal controls, aka "IndirectUI",
Derive from FileType<TToken, TTWidget> if you need to show settings on Save dialog using your own controls
You need to implement your own dialog and controls if you need to show settings when opening a file (in OnLoad method). This isn't something supported officially but possible.
A very simple implementation that derives from FileType:
https://github.com/PsdPlugin/PsdPlugin/blob/master/PhotoShopFileType/PhotoshopFileType.cs
The code I've posted should go into the Document OnLoad(System.IO.Stream input) method. You create the document using the input stream, return it and then paint.net opens it.
Also @null54 has lots of open source file type plugins. They helped me a lot when learning stuff.
https://github.com/0xC0000054?tab=repositories&q=paint.net+filetype