These are chat archives for ExtCore/ExtCore

19th
Mar 2017
NetSharp
@NetSharp
Mar 19 2017 14:25
Hi guys, any good suggestions in how to integrate events? I want Plugins to be able to Register to Events fron the host Application and vice versa
Or is that already implemented and I'm to blind?
Dmitry Sikorsky
@DmitrySikorsky
Mar 19 2017 14:29
@Flying--Dutchman Hi! Yes, ExtCore covers your needs for 100%. Feel free to ask in details, I will try to help.
You can have content plugins, web api plugins, plugins with controllers, views, scripts, images, different services and classes etc.
And it works in VS2017 with no problems starting from version 1.1.3
@NetSharp Hi! I think this is good idea to implement as shared ExtCore extension and make it availanle for everybody. Sounds interesting, also I want something similar in my CMS project (Platformus). To make it possible for users to know when some object is changed.
Could you describe your task in details?
NetSharp
@NetSharp
Mar 19 2017 14:40
I want to expand my c# knowledge by building a CRM or something like that. Therefore I want plugins to have the ability to react when a new customer is added or an existing one is altered. Something like that.
But I had to be honest with myself, that it would be too hard for me to implement. My C# knowledge is unfortunately still very basic
Dmitry Sikorsky
@DmitrySikorsky
Mar 19 2017 14:42
The first idea is to create static class like CustomerObserver and add AddListener method to it. When you customer is changed you can call CustomerObserver's NotifyListeners method and it will call all the delegates added by AddListener
I think it is as simple as writing 20 lines of code :)
OR
if we talk about the modular framework
we can implement listeners as something like IListener
and when customer is changed we just use ExtCore to get all the implementations of IListener and call method on them, it is even easier
ExtCore allows to get all the implementations (or instances) of the given type from all the extenstions:
You can find line 'Toolbars = ExtensionManager.GetInstances<IToolbar>()' there
Do you need the detailed explanation?
NetSharp
@NetSharp
Mar 19 2017 14:51
Wow, thanks for your great reply. Did not expect that :)
Will look into it tonight. If I need any help, i will let you know. Thank you very much! Would guess that something like this is also needed for a extensible CMS.
Dmitry Sikorsky
@DmitrySikorsky
Mar 19 2017 15:00
No problems, feel free to ask! I will be happy to try to help.