X hits on this document

1228 views

0 shares

0 downloads

0 comments

350 / 396

Appendix ‎A   Documentation comments

A.2.4

<exception>

This tag provides a way to document the exceptions a method can throw.

Syntax:

<exception cref="member">description</exception>

where

cref="member"

The name of a member. The documentation generator checks that the given member exists and translates member to the canonical element name in the documentation file.

description

A description of the circumstances in which the exception is thrown.

Example:

public class DataBaseOperations { /// <exception cref="MasterFileFormatCorruptException"></exception> /// <exception cref="MasterFileLockedOpenException"></exception> public static void ReadRecord(int flag) { if (flag == 1) throw new MasterFileFormatCorruptException(); else if (flag == 2) throw new MasterFileLockedOpenException(); // … } }

A.2.5

<include>

This tag allows including information from an XML document that is external to the source code file. The external file must be a well-formed XML document, and an XPath expression is applied to that document to specify what XML from that document to include. The <include> tag is then replaced with the selected XML from the external document.

Syntax:

<include file="filename" path="xpath" />

where

file="filename"

The file name of an external XML file. The file name is interpreted relative to the file that contains the include tag.

path="xpath"

An XPath expression that selects some of the XML in the external XML file.

Example:

If the source code contained a declaration like:

/// <include file="docs.xml" path='extradoc/class[@name="IntList"]/*' /> public class IntList { … }

and the external file “docs.xml” had the following contents:

Copyright Microsoft Corporation 1999-2003. All Rights Reserved.337

Document info
Document views1228
Page views1228
Page last viewedThu Jan 19 15:15:53 UTC 2017
Pages396
Paragraphs9401
Words133190

Comments