pthompson
(pthompson)
March 14, 2024, 9:58pm
1
I asked a question 10 years ago
Is it possible to access the ModuleControllerAttribute data of a .NET module controller from the Delphi side ?
I’m looking for something like HYModuleManager.Modules[Index].UserData i.e. the equivalent of an individual plugins data e.g. HYModuleManager.PluginDescriptors[Index].UserData. The plugin data I can get and use, the module data I can’t.
Thanks.
… and have been accessing the module controller meta data in Delphi ever since.
How do I do the same from .NET ?
Specifically, if I have the ModuleControllerAttribute data in a .NET plugin :-
Under debug in VS I see :-
In Delphi I would do this :-
FrmMain.HYModuleManager.Modules[iLoop].ModuleController.Descriptor.Description;
What am I missing in .NET to be able to get access to the Description and UserData attributes ?
EvgenyK
(Evgeny Karpov)
March 15, 2024, 9:33am
2
Hi,
In Delphi you have object (THYVCLModuleController
), in .NET you have interface (IHYCrossPlatformModuleController
).
You can’t get attributes from this interface…
ofc, you can implement own interface that will return such info…
I can suggest to put such info into Plugin
attributes like
[Plugin, VisualPlugin(Description = 'my description', UserData := '1.1.1')]
MyOxygeneManagedPlugin = public class(RemObjects.Hydra.VisualPlugin)
this info can be easily received like
pthompson
(pthompson)
March 15, 2024, 11:06am
3
Thanks Evgeny,
I just wanted to keep the .NET shell / plugin loader similar to the Delphi one and was looking to make use of the same meta data.
The Plugins attributes we already use, but each DLL has multiple plugins in it whereas the module controller meta data is singular i.e. a description and version info for all plugins in the DLL.
It’s not a big issue as we can go via GetAssembly and get the same information as we put it in there also.
Thanks again for confirming.