.NET

Reply
Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 11 of 12 (94 Views)

Re: Start-up & initialize

06-16-2013 11:05 AM in reply to: BlackBox_

BlackBox_ wrote:
Fair enough; so you're sayin something like:

if (<criteria is not met>)
throw new <?.>Exception();

... Would do the trick?

Yes.  The managed runtime loader will catch any exception thrown.  If the OP wants to inform the user that the commands are not available, he can display a message before throwing the exception.

Distinguished Mentor
BlackBox_
Posts: 785
Registered: ‎02-25-2013
Message 12 of 12 (87 Views)

Re: Start-up & initialize

06-16-2013 11:50 AM in reply to: DiningPhilosopher

DiningPhilosopher wrote:

BlackBox_ wrote:
Fair enough; so you're sayin something like:

if (<criteria is not met>)
throw new <?.>Exception();

... Would do the trick?

Yes.  The managed runtime loader will catch any exception thrown.  If the OP wants to inform the user that the commands are not available, he can display a message before throwing the exception.


Thank you for clarifying... Perhaps in error, I picked up that this was 'a bad thing' to do in Initialize, and didn't realize one could intentionally employ Exceptions to prevent other assembly code from being loaded.

 

In contrast, I did learn from Gile's LispException helper Classes that one could do so when evaluating a ResultBuffer; I clearly didn't connect the dots.

 

As always, I appreciate the knowledge you share with the community.

 

Cheers



"Potential has a shelf life." - Margaret Atwood


Autodesk Exchange Apps ~ Autoloader ~ AutoCAD Security


AutoCAD® 2014, and Civil 3D® 2014 Certified Professional ~ Autodesk® Authorized Developer

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.