Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
There are two things you need to do in order to use the types declared in a given namespace. First, you have to tell the compiler about the namespace by setting a reference, and then you tell the code file about it with the using directive. (Technically, the using directive isn’t necessary, but as we’ll see, it saves a lot of typing.) To get our feet wet, let’s create a very cool version of “Hello, World!” using the System.Speech namespace.
0 Create a new WPF project and add a button to the window.
1 We’ll need a reference to the System.Speech namespace. You add references from the Add Reference dialog, available from the Project menu and the Reference node context menu in the Solution Explorer. Open it now, and display the .NET tab.