[Question] Design of an AddIn - Split into Modules possible?

Add-in Express™ Support Service
That's what is more important than anything else

[Question] Design of an AddIn - Split into Modules possible?
 
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,
Sven
Best regards,

Sven Heitmann
Posted 28 Sep, 2004 02:18:33 Top
Eugene Starostin


ADX Team
Add-in Express team


Posts: 430
Joined: 2004-04-05
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.
Posted 28 Sep, 2004 08:24:11 Top
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
Posted 28 Sep, 2004 09:34:10 Top
Sergey Grischenko


Add-in Express team


Posts: 7187
Joined: 2004-07-05
Hi,

I have just sent you an example project. Please check your mail box.
Posted 28 Sep, 2004 10:24:19 Top
Sven Heitmann




Posts: 193
Joined: 2004-08-23
thank you... that's it =)
Best regards,

Sven Heitmann
Posted 28 Sep, 2004 11:18:52 Top