Perregrinne

New learning resources for building FileType plugins?

Recommended Posts

I think a lot of the information regarding how to build FileType plugins has become too outdated, and in some cases pretty much obsolete. A few places point to Simon Brown's template, but it doesn't even download a zip anymore, like it says it's supposed to. Midora made a template for Visual Studio 2010 which I'm using now, but it throws errors, like for FileTypeFlags, which are obsolete now. I dug through some current plugin repositories and eventually found some with the new method, but Visual Studio does not like like me using the SaveExtensions or LoadExtensions in the "new FileTypeOptions" block (it says SaveExtensions and LoadExtensions are not defined or imported, though SupportsLayers is found just fine). I can't tell if this is because the solution is from VS 2010 or there was something I was supposed to reference or hook up to the project. I would really like to create a new, modern template for FileType plugins and create explanations or documentation on how to use it, but I only just started making plugins for PDN today, and it's been a while since I last used C#. Does anyone already have any plans to do this? If not, maybe in time when I get better at this I can try. By the way, I'm currently using Visual Studio 2019 Community and .Net Framework 4.7.2 if that helps clarify the issues, and that's what I would use to develop a new template, if I did this.

Edited by Perregrinne
Clarification about VS 2019

Share this post


Link to post
Share on other sites

Well, the title of this topic seems to be pretty fitting, maybe I'll just keep adding little notes I learn to this topic. To get rid of the SaveExtensions error mentioned above, right-click your .csproj in the solution explorer and click "Properties". Then switch the target framework from .Net Framework 3.5 to 4.7.2 and don't forget to File -> Save All (Hotkey: ctrl+shift+s) afterwards.

Edited by Perregrinne
Typo in old framework.

Share this post


Link to post
Share on other sites
16 hours ago, Perregrinne said:

I would really like to create a new, modern template for FileType plugins ... Does anyone already have any plans to do this?

 

Having more up-to-date example solution/project files would be nice for noobies, but you know what would be even better?  Visual Studio Project Templates!

 

For any confused people, these are Visual Studio Project Templates:

vsTemplates.png

 

We could have a VSIX package with the following template variations:

  • FileType
  • FileType<TToken, TWidget>
  • PropertyBasedFileType
  • Effect
  • Effect<TToken>
  • PropertyBasedEffect

 

Links for more information:

https://docs.microsoft.com/en-us/visualstudio/ide/how-to-create-project-templates

https://docs.microsoft.com/en-us/visualstudio/extensibility/shipping-visual-studio-extensions

 

Share this post


Link to post
Share on other sites

In regards to my idea for a VS Extension, I've got a proof-of-concept working:

 

pdnTemplates.png

 

I'll probably work on it some more over the weekend.

If anyone wants to contribute or has additional ideas for it, let me know.

  • Like 1

Share this post


Link to post
Share on other sites

I'll put on GitHub when I get it more fleshed out this weekend. A few of the Templates don't actually work as intended yet.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.