{"id":182,"date":"2010-01-11T12:04:57","date_gmt":"2010-01-11T12:04:57","guid":{"rendered":"http:\/\/dirk.forbiddendream.be\/?p=182"},"modified":"2016-01-07T10:50:18","modified_gmt":"2016-01-07T10:50:18","slug":"creating-plugins-in-c","status":"publish","type":"post","link":"https:\/\/dirk.schuermans.me\/?p=182","title":{"rendered":"Creating plugins in C#: How does it work? (Part 1\/4)"},"content":{"rendered":"<p>Hello everyone,<\/p>\n<p>I&#8217;ve learned a fancy new thing in C#:<\/p>\n<p>Working with plugins<\/p>\n<p>So today I&#8217;m going to explain how the basics work, what you need in order to have your application work with plugins.<br \/>\nLet&#8217;s get started shall we? \ud83d\ude42<\/p>\n<p><!--more--><\/p>\n<h1>How does it work?<\/h1>\n<p>If you work with plugins, the basic scheme of your solution will look like this:<\/p>\n<figure id=\"attachment_183\" aria-describedby=\"caption-attachment-183\" style=\"width: 494px\" class=\"wp-caption alignnone\"><a rel=\"attachment wp-att-183\" href=\"http:\/\/dirk.schuermans.me\/?attachment_id=183\"><img loading=\"lazy\" class=\"size-full wp-image-183\" title=\"Plugin Scheme\" src=\"http:\/\/dirk.schuermans.me\/wp-content\/uploads\/2010\/01\/plugin_scheme.png\" alt=\"The plugin scheme\" width=\"494\" height=\"91\" srcset=\"https:\/\/dirk.schuermans.me\/wp-content\/uploads\/2010\/01\/plugin_scheme.png 494w, https:\/\/dirk.schuermans.me\/wp-content\/uploads\/2010\/01\/plugin_scheme-300x55.png 300w\" sizes=\"(max-width: 494px) 100vw, 494px\" \/><\/a><figcaption id=\"caption-attachment-183\" class=\"wp-caption-text\">Basic plugin scheme<\/figcaption><\/figure>\n<p>The main idea is that you have a layer between your application and your plugin that allows your application to load the plugin.<br \/>\nThat is what the handler is for.<\/p>\n<p>Both the application and plugin will have a reference to the DLL containing the handler, allowing the application to check if the plugin is a valid plugin and if it is, load it.<\/p>\n<p>This will become more clear later on in the tutorial.<\/p>\n<h2>The solution<\/h2>\n<p>Start with creating a new blank solution (<em>Other project types &gt; Visual Studio Solutions &gt; Blank Solution<\/em>) and name it <strong>TestPlugin<\/strong><\/p>\n<p>Throughout this entire tutorial we&#8217;ll be working from within the <strong>same<\/strong> solution!<\/p>\n<p><strong><a href=\"http:\/\/dirk.schuermans.me\/?p=228\" target=\"_self\">Continue to the next part of this tutorial&#8230;<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello everyone, I&#8217;ve learned a fancy new thing in C#: Working with plugins So today I&#8217;m going to explain how the basics work, what you need in order to have your application work with plugins. Let&#8217;s get started shall we? \ud83d\ude42<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[38,6],"tags":[],"_links":{"self":[{"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/posts\/182"}],"collection":[{"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=182"}],"version-history":[{"count":4,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions"}],"predecessor-version":[{"id":548,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=\/wp\/v2\/posts\/182\/revisions\/548"}],"wp:attachment":[{"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=182"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=182"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dirk.schuermans.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=182"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}