Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
C# ПІДРУЧНИКИ / c# / Hungry Minds - Visual C# Blueprint.pdf
Скачиваний:
101
Добавлен:
12.02.2016
Размер:
9.71 Mб
Скачать

C#

ENTER XML DOCUMENTATION

After you document your code and compile it, C# automatically changes that code into Extensible Markup Language, XML, format. XML comments

let you pass those comments easily if you want to share them with others, such as on a corporate Intranet, for feedback.

XML is a cross between HTML, Hypertext Markup Language, and the more powerful SGML, Standard Generalized Markup Language. XML contains greater flexibility than HTML but XML is not as hard to learn and use as SGML is.

XML is the default documentation language for Visual Studio .NET. You can compile the XML comments in your

program into an XML file that can then be shared on the Internet or on your company intranet using your Internet browser, provided that your browser is XML-capable.

However, the job of processing the XML file so that it can create XML documentation is up to your site Webmaster.

XML documentation in your program starts with three slash marks, ///. Visual C# also includes 14 built-in XML tags for user documentation such as the <summary> tag. Visual C# processes the XML tags on types and type members such as classes, and that is why you will see some XML documentation when you view the code in a Visual C# project, other than an empty project, that is.

ENTER XML DOCUMENTATION

Console

Applicatio

Click New Project in the

page.

The New Project window appears.

Click the Console Application icon in the Templates pane.

Type a name for your file.

ˇ Click OK.

WORKING WITH VISUAL C# BASICS 3

You can also use the slash-and-asterisk combination — /* and */ — just as you do with Java and C++ if you prefer doing so.

TYPE THIS:

using System;

/* This is a comment about the following class. */

public class Class1;RESULT:

As with Java and C++, remember that the asterisk always appears immediately before and after the comment text.

Á Replace the summary comments with your own text.

Type three slashes (///) before the Main method in your text.

The summary XML tags and the ancillary param tag appear automatically.

° Add the <c> XML tag for denoting code.

The closing </c> code appears automatically.

· Type your comment text with your code text between the <c> and </c> codes.

Save the program as the filename.

59

C#

ACCESS DOCUMENTATION

The MDE window gives you access to many different sources of help so you can get the answers you need quickly and get back to programming.

These sources include online text files that provide help and online resources from the Microsoft Web site. The online help files and Web pages appear directly within the MDE window so you do not have to close the MDE window and open a new one.

Visual Studio .NET installs online help as part of its installation process. You can access these files directly from the MDE window menu bar. Visual Studio .NET groups

these files by topic so you can find what you want easily. If you need more powerful search features, you can search by keywords and other criteria such as limiting results to Visual C# topics. When you view a help page, it appears in the parent window as another tab so you can switch between your help page and C# program.

When you view the online help features, those Web pages appear in the parent window as well. You can navigate these pages just as you would in a Web browser so you can find the information you want. The MDE window also includes a built-in online search feature so you can find what you need online more effectively.

ACCESS DOCUMENTATION

Note: If you have a dial-up Internet connection, your dial-up connection window will appear so you can dial your Internet service provider. If you cannot connect to the Internet, the parent window displays an action cancelled message stating that Internet Explorer was unable to connect.

Visual C#

The Headlines screen appears in the Start menu with the Features tab selected.

Click to the right of the Filter field.

Filter the headline articles to show Visual C# articles only by clicking Visual C#.

WORKING WITH VISUAL C# BASICS 3

If you decide to view a Webcast in MSDN Online that requires Windows Media Player and you do not have the Player, you can download the Player from the Webcast’s opening HTML screen that contains an overview of the Webcast and links to download the Player.

You can send feedback directly from the MSDN Online site by clicking the Send Us Your Feedback link at the lower left-hand corner of the MSDN Online window. After you click the link, you can enter feedback on the MSDN articles or features or submit a bug report about the MSDN Web site, but not about Visual Studio

.NET.

You can search for specific articles within MSDN Online by entering a search phrase in the Enter Search Phrase text box in the upper–left of the MSDN Online window and then click the Search button. The results will then appear in the MSDN Online window. If you need to conduct a more refined search, you can click the Advanced link below the Search button.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

ˇ Click the Technical

The latest technical articles

Á Click the Knowledge

Knowledge Base articles

Articles tab.

about C# appear.

Base tab.

appear that contain the latest

 

 

 

 

 

 

C# support issues.

61

Соседние файлы в папке c#