.NET

Reply
Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 11 of 12 (84 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: 770
Registered: ‎02-25-2013
Message 12 of 12 (77 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

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.