.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Modules and CommandMethods

1 REPLY 1
Reply
Message 1 of 2
Anonymous
156 Views, 1 Reply

Modules and CommandMethods

I'm using VB for development with the .NET api. In VB, a module is in fact a
disguised notinheritable and not creatable class with only shared members.
So, I've tried to declare command methods in modules and this seems to
work... so far.
One advantage of doing this is not having to type "Shared" and the second is
that you cannot *forget* to add "Shared" (in which case AutoCAD creates a
new instance of a class for every document). Still I wonder if anybody
ever had any problems doing this, some snake in the snodgrass, say. Thanks
for any information on this.
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Get Reflector and look at your assembly in it, to see how VB.NET mangles it.

There's a lot of compiler-generated code in VB.NET. For example, if you use the WithEvents keyword, you will see a bunch of generated code that runs every time you assign a value to the variable, and VB.NET makes the variable a property in order to hook into the assignment.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2009
Supporting AutoCAD 2000 through 2009
http://www.acadxtabs.com

"Guido Rooms" wrote in message news:5898482@discussion.autodesk.com...
I'm using VB for development with the .NET api. In VB, a module is in fact a
disguised notinheritable and not creatable class with only shared members.
So, I've tried to declare command methods in modules and this seems to
work... so far.
One advantage of doing this is not having to type "Shared" and the second is
that you cannot *forget* to add "Shared" (in which case AutoCAD creates a
new instance of a class for every document). Still I wonder if anybody
ever had any problems doing this, some snake in the snodgrass, say. Thanks
for any information on this.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


Autodesk Design & Make Report