Sven Heitmann
Posts: 193
Joined: 2004-08-23
|
Hi,
I have written an AddIn where the AddIn CS File has about 2200 Lines...
The AddIn contains about 9 CommandBars with 30 Controls .
The most of the code is produced by the Designer.
My Question is: "Is the following possible?"
I would like create a new Class, ADXModule.
This Class will contain all the code for a CommandBar and his Controls (all the Designer created code and the EventHandler for the Controls).
The AddIn class will initialize and reference to such modules.
What do you think about it?
Possible?
A good way?
Best regards,
SvenBest regards,
Sven Heitmann |
|
Eugene Starostin
Guest
|
Hi Sven,
Do you mean "an add-in module per a CommandBar"?
If yes, it is possible. But you should understand that an add-in module is an add-in, i.e. you get several addins with several add-in modules, and vice versa.
But we will try to find the best way to do this.
|
|
Sven Heitmann
Posts: 193
Joined: 2004-08-23
|
hm...
I will try to explain what I mean...
Currently a new Class is created wich extends from ADXAddinModule.
This class supports the Designer where you can add the ADXCommandBars, ADXBuiltInControls...
When you add about 9 ADXCommandBars, each with 5 Controls you finally have 45 Controls in your class with all the code by the Designer to initialize them and all the EventHandler code for the Actions.
What I thought about was a new class wich is a "Wrapper" around a ADXCommandBar, it's Controls and EventHandler.
The result would be that my code in my AddInModule is much cleaner.
You will keep one class wich extends from ADXAddInModule but instead of 9 references to ADXCommandBars and 45 References to ADXCommandBarControls or ADXCommandBarButtons you have just 9 References to objects of the Wrapperclass.
Additionally the Code Inside of the "InitializeComponents" would be much cleaner because all the Initialization of the CommandBars and Controls is done inside the Wrapperclass.
However you have to connect the CommandBars and Controls to the AddInModule, because its loading the Components.
Thats just some thoughts... I don't like classes/files with 2000 lines of code ;)
Best regards,
Sven Heitmann |
|
Sergey Grischenko
Add-in Express team
Posts: 7233
Joined: 2004-07-05
|
Hi,
I have just sent you an example project. Please check your mail box. |
|
Sven Heitmann
Posts: 193
Joined: 2004-08-23
|
thank you... that's it =)
Best regards,
Sven Heitmann |
|