Today’s tip is actually a continuation from yesterday’s, as the Create Instance and Invoke Static Method actually are a part of the Class Diagram implementation. I don’t know too much about the Class Diagram, so I’ll just write a quick tip that these method exists and here’s the Invoke Static Method command in action.

Invoke Static Method on the Class View context menu

When I run the Invoke Static Method command on the SayHello() method, I’m prompted whether to run the method.

Invoke Method message box

Pressing Okay launching the command prompt window.

Hello World in Command Prompt

when terminating the command prompt (I have a Console.Read() going on here, so i press Enter to finish executing the method), another prompt appears that everything succeeded.

Method Call Executed Successfully message box

But if it didn’t (by closing the command prompt so that the Console.Read() never finished), I get this message box instead.

Method Invoke Failed message box

Technorati Tags: VS2005Tip,VS2008Tip