G
G
GFX Data2018-02-03 19:24:55
C++ / C#
GFX Data, 2018-02-03 19:24:55

C# - connecting listeners and data through attributes?

Hello.
(The question may even be about Unity (3d))
I'm looking for something interesting for connecting a delegate / method through an attribute, from Google I did not find how to sign an instance method for execution by an external call. First of all control of instantiation.
More or less like this:

[Handler("SomeEvent", "SomeModel"...)]
public void SomeEventHandler(Event e) {}

[DataInject("SomeDataProvider")]
public ObservableCollection<DataItem> list;

I met such a concept in ActionScript3 (flash), although there the core of the injection engine had to pass the creation of an instance through itself.
[Inject]
public var model:MainModel;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question