4 mdoc-html-utils.xsl: ECMA-style docs to HTML stylesheet transformation utils
6 Author: Joshua Tauberer (tauberer@for.net)
7 Author: Jonathan Pryor (jpryor@novell.com)
9 This file requires that including files define the following callable
11 - CreateCodeBlock (language, content)
12 - CreateEnumerationTable (content)
13 - CreateHeader (content)
14 - CreateListTable (header, content)
15 - CreateMembersTable (content)
16 - CreateSignature (content)
17 - CreateTypeDocumentationTable (content)
18 - GetLinkTarget (type, cref)
25 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
26 xmlns:msxsl="urn:schemas-microsoft-com:xslt"
27 exclude-result-prefixes="msxsl"
29 <xsl:import href="mdoc-html-format.xsl" />
31 <!-- TEMPLATE PARAMETERS -->
32 <xsl:param name="language" select="'C#'"/>
33 <xsl:param name="index" />
34 <xsl:param name="source-id"/>
36 <xsl:variable name="ThisType" select="/Type"/>
38 <!-- The namespace that the current type belongs to. -->
39 <xsl:variable name="TypeNamespace" select="substring(/Type/@FullName, 1, string-length(/Type/@FullName) - string-length(/Type/@Name) - 1)"/>
41 <!-- THE MAIN RENDERING TEMPLATE -->
43 <!-- TYPE OVERVIEW -->
45 <xsl:template name="CreateTypeOverview">
46 <xsl:param name="implemented" />
47 <xsl:param name="show-members-link" />
49 <xsl:attribute name="id">
50 <xsl:text>T:</xsl:text>
51 <xsl:call-template name="GetEscapedTypeName">
52 <xsl:with-param name="typename" select="@FullName" />
54 <xsl:text>:Summary</xsl:text>
57 <div class="msummary">
58 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
59 <xsl:apply-templates select="Docs/summary" mode="editlink"/>
62 <xsl:if test="$implemented">
63 <p><b>Mono Implementation Note: </b></p>
65 <xsl:value-of disable-output-escaping="yes" select="$implemented"/>
69 <xsl:if test="$show-members-link and not(Base/BaseTypeName='System.Enum' or Base/BaseTypeName='System.Delegate' or Base/BaseTypeName='System.MulticastDelegate') and count(Members)">
73 <xsl:attribute name="href">
74 <xsl:text>T</xsl:text>
75 <xsl:call-template name="GetLinkId">
76 <xsl:with-param name="type" select="." />
77 <xsl:with-param name="member" select="." />
79 <xsl:text>/*</xsl:text>
81 <xsl:value-of select="translate(@Name, '+', '.')"/>
82 <xsl:value-of select="' '" />
83 <xsl:text>Members</xsl:text>
89 Inheritance tree, but only for non-standard classes and not for interfaces
91 <xsl:if test="not(Base/BaseTypeName='System.Enum' or Base/BaseTypeName='System.Delegate' or Base/BaseTypeName='System.ValueType' or Base/BaseTypeName='System.Object' or Base/BaseTypeName='System.MulticatDelegate' or count(Base/ParentType)=0)">
93 <xsl:for-each select="Base/ParentType">
94 <xsl:sort select="@Order" order="descending"/>
95 <xsl:variable name="p" select="position()" />
96 <xsl:for-each select="parent::Base/ParentType[position() < $p]">
97 <xsl:value-of select="'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'" disable-output-escaping="yes"/>
100 <xsl:attribute name="href">
101 <xsl:call-template name="GetLinkTargetHtml">
102 <xsl:with-param name="type" select="@Type" />
103 <xsl:with-param name="cref">
104 <xsl:text>T:</xsl:text>
105 <xsl:call-template name="GetEscapedTypeName">
106 <xsl:with-param name="typename" select="@Type" />
111 <xsl:value-of select="@Type"/>
116 <xsl:for-each select="Base/ParentType">
117 <xsl:value-of select="'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'" disable-output-escaping="yes"/>
119 <xsl:value-of select="@FullName"/>
123 <xsl:if test="Base/BaseTypeName='System.Enum'">
125 The type of the values in this enumeration is
126 <xsl:apply-templates select="Members/Member[@MemberName='value__']/ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>.
131 <xsl:template name="CreateTypeSignature">
132 <xsl:call-template name="CreateSignature">
133 <xsl:with-param name="id">
134 <xsl:text>T:</xsl:text>
135 <xsl:call-template name="GetEscapedTypeName">
136 <xsl:with-param name="typename" select="@FullName" />
138 <xsl:text>:Signature</xsl:text>
140 <xsl:with-param name="content">
143 <xsl:when test="$language='C#'">
145 <xsl:for-each select="Attributes/Attribute">
146 <xsl:text>[</xsl:text>
147 <xsl:value-of select="AttributeName"/>
148 <xsl:text>]</xsl:text>
152 <xsl:for-each select="ReturnValue/Attributes/Attribute">
153 <xsl:text>[return:</xsl:text>
154 <xsl:value-of select="AttributeName"/>
155 <xsl:text>]</xsl:text>
161 <xsl:when test="Base/BaseTypeName='System.Enum'">
162 <xsl:call-template name="getmodifiers">
163 <xsl:with-param name="sig" select="TypeSignature[@Language='C#']/@Value"/>
166 <xsl:text>enum </xsl:text>
168 <!-- member name, argument list -->
170 <xsl:value-of select="translate (@Name, '+', '.')"/>
174 <xsl:when test="Base/BaseTypeName='System.Delegate' or Base/BaseTypeName='System.MulticastDelegate'">
177 <xsl:when test="count(Parameters) > 0 and count(ReturnValue) > 0">
178 <!-- Only recreate the delegate signature if the appropriate information
179 is present in the XML file. -->
181 <xsl:call-template name="getmodifiers">
182 <xsl:with-param name="sig" select="TypeSignature[@Language='C#']/@Value"/>
185 <xsl:text>delegate </xsl:text>
187 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
190 <xsl:value-of select="' '"/>
192 <!-- member name, argument list -->
194 <xsl:call-template name="GetDefinitionName">
195 <xsl:with-param name="name" select="translate (@Name, '+', '.')" />
196 <xsl:with-param name="TypeParameters" select="TypeParameters" />
201 <xsl:value-of select="' '"/>
203 <xsl:value-of select="'('"/> <!-- prevents whitespace issues -->
205 <xsl:for-each select="Parameters/Parameter">
206 <xsl:call-template name="ShowParameter">
207 <xsl:with-param name="Param" select="."/>
208 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
211 <xsl:if test="not(position()=last())">, </xsl:if>
214 <xsl:value-of select="')'"/>
219 <xsl:apply-templates select="TypeSignature[@Language=$language]/@Value"/>
228 <xsl:call-template name="getmodifiers">
229 <xsl:with-param name="sig" select="TypeSignature[@Language='C#']/@Value"/>
230 <xsl:with-param name="typetype" select="true()"/>
233 <xsl:value-of select="' '"/>
236 <xsl:call-template name="GetDefinitionName">
237 <xsl:with-param name="name" select="translate (@Name, '+', '.')" />
238 <xsl:with-param name="TypeParameters" select="TypeParameters" />
242 <xsl:variable name="HasStandardBaseType" select="Base/BaseTypeName='System.Object' or Base/BaseTypeName='System.ValueType'"/>
243 <xsl:variable name="HasBaseType" select="count(Base/BaseTypeName)>0"/>
244 <xsl:if test="(($HasBaseType) and not($HasStandardBaseType)) or not(count(Interfaces/Interface)=0)">
245 <xsl:text> : </xsl:text>
247 <xsl:if test="$HasBaseType and not($HasStandardBaseType)">
248 <xsl:apply-templates select="Base/BaseTypeName" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
249 <xsl:if test="not(count(Interfaces/Interface)=0)">, </xsl:if>
252 <xsl:for-each select="Interfaces/Interface">
253 <xsl:if test="not(position()=1)">, </xsl:if>
254 <xsl:apply-templates select="InterfaceName" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
262 <xsl:call-template name="CreateGenericConstraints">
263 <xsl:with-param name="TypeParameters" select="TypeParameters" />
269 <xsl:apply-templates select="TypeSignature[@Language=$language]/@Value"/>
277 <xsl:template name="GetDefinitionName">
278 <xsl:param name="name" />
279 <xsl:param name="TypeParameters" />
282 <!-- do NOT process explicitly implemented generic interface members
283 unless they're actually generic methods. -->
284 <xsl:when test="contains ($name, '>') and
285 '>' = substring ($name, string-length ($name), 1)">
286 <xsl:value-of select="substring-before ($name, '<')" />
287 <xsl:text><</xsl:text>
288 <xsl:for-each select="$TypeParameters/TypeParameter">
289 <xsl:for-each select="Attributes/Attribute">
290 <xsl:text>[</xsl:text>
291 <xsl:value-of select="AttributeName"/>
292 <xsl:text>] </xsl:text>
295 <xsl:when test="@Name">
296 <xsl:value-of select="@Name" />
299 <xsl:value-of select="." />
302 <xsl:if test="not(position()=last())">, </xsl:if>
304 <xsl:text>></xsl:text>
307 <xsl:value-of select="$name" />
312 <xsl:template name="CreateGenericConstraints">
313 <xsl:param name="TypeParameters" />
315 <xsl:for-each select="$TypeParameters/TypeParameter">
316 <xsl:variable name="constraintsCount" select="count(Constraints/*)" />
317 <xsl:if test="$constraintsCount > 0 and count(Constraints/*[.='Contravariant' or .='Covariant']) != $constraintsCount">
318 <xsl:call-template name="CreateGenericParameterConstraints">
319 <xsl:with-param name="constraints" select="Constraints" />
325 <xsl:template name="CreateGenericParameterConstraints">
326 <xsl:param name="constraints" />
329 <xsl:text> where </xsl:text>
330 <xsl:value-of select="@Name" />
331 <xsl:text> : </xsl:text>
332 <xsl:variable name="kind"
333 select="count($constraints[ParameterAttribute='ReferenceTypeConstraint'])+
334 count($constraints[ParameterAttribute='NotNullableValueTypeConstraint'])" />
335 <xsl:variable name="base" select="count($constraints/BaseTypeName)" />
336 <xsl:variable name="iface" select="count($constraints/InterfaceName)" />
337 <xsl:variable name="struct" select="$constraints/ParameterAttribute='NotNullableValueTypeConstraint'" />
338 <xsl:if test="$constraints/ParameterAttribute='ReferenceTypeConstraint'">
339 <xsl:text>class</xsl:text>
341 <xsl:if test="$constraints/ParameterAttribute='NotNullableValueTypeConstraint'">
342 <xsl:text>struct</xsl:text>
344 <xsl:if test="$constraints/BaseTypeName and not($struct)">
345 <xsl:if test="$kind">, </xsl:if>
346 <xsl:apply-templates select="$constraints/BaseTypeName" mode="typelink" />
348 <xsl:for-each select="$constraints/InterfaceName">
349 <xsl:if test="position()=1">
350 <xsl:if test="$kind or $base">, </xsl:if>
352 <xsl:apply-templates select="." mode="typelink" />
353 <xsl:if test="not(position()=last())">, </xsl:if>
355 <xsl:if test="$constraints/ParameterAttribute='DefaultConstructorConstraint' and not($struct)">
356 <xsl:if test="$base or $iface">, </xsl:if>
357 <xsl:text>new()</xsl:text>
361 <xsl:template name="CreateMemberOverview">
362 <xsl:param name="implemented" />
364 <div class="msummary">
365 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
366 <xsl:apply-templates select="Docs/summary" mode="editlink"/>
369 <xsl:if test="$implemented">
370 <p><b>Mono Implementation Note: </b></p>
372 <xsl:value-of disable-output-escaping="yes" select="$implemented"/>
376 <!-- member value -->
377 <xsl:if test="MemberValue">
379 <xsl:value-of select="MemberValue"/>
385 <xsl:template name="CreateRelatedSection">
386 <xsl:param name="section" />
387 <xsl:param name="type" />
388 <xsl:if test="count(Docs/related[@type=$type])">
389 <h3 class="{$type}"><xsl:value-of select="$section" /></h3>
391 <xsl:for-each select="Docs/related[@type=$type]">
392 <li><a href="{@href}" target="_blank"><xsl:value-of select="." /></a></li>
398 <xsl:template name="CreatePlatformRequirements">
399 <!-- For now we only have that information in MonoTouch so only process that -->
400 <xsl:if test="starts-with(/Type/@FullName, 'MonoTouch')">
402 <!-- We first check if we have a [Since] at the member level -->
403 <xsl:when test="count(Attributes/Attribute/AttributeName[starts-with(text(), 'MonoTouch.ObjCRuntime.Since')])">
404 <b>Minimum iOS version: </b>
405 <xsl:value-of select="translate(substring-before (substring-after (Attributes/Attribute/AttributeName[starts-with(text(), 'MonoTouch.ObjCRuntime.Since')], 'MonoTouch.ObjCRuntime.Since('), ')'), ', ', '.')" />
408 <!-- If not, we then check at the type level -->
409 <xsl:when test="count(/Type/Attributes/Attribute/AttributeName[starts-with(text(), 'MonoTouch.ObjCRuntime.Since')])">
410 <b>Minimum iOS version: </b>
411 <xsl:value-of select="translate(substring-before (substring-after (/Type/Attributes/Attribute/AttributeName[starts-with(text(), 'MonoTouch.ObjCRuntime.Since')], 'MonoTouch.ObjCRuntime.Since('), ')'), ', ', '.')" />
418 <xsl:template name="CreateMemberSignature">
419 <xsl:param name="linkid" select="''" />
421 <xsl:call-template name="CreateSignature">
422 <xsl:with-param name="content">
423 <xsl:if test="contains(MemberSignature[@Language='C#']/@Value,'this[')">
424 <p><i>This is the default property for this class.</i></p>
427 <!-- recreate the signature -->
429 <xsl:for-each select="Attributes/Attribute[AttributeName != 'System.Runtime.CompilerServices.Extension']">
430 <xsl:text>[</xsl:text>
431 <xsl:value-of select="AttributeName"/>
432 <xsl:text>]</xsl:text>
436 <xsl:for-each select="ReturnValue/Attributes/Attribute">
437 <xsl:text>[return:</xsl:text>
438 <xsl:value-of select="AttributeName"/>
439 <xsl:text>]</xsl:text>
443 <xsl:call-template name="getmodifiers">
444 <xsl:with-param name="sig" select="MemberSignature[@Language='C#']/@Value"/>
447 <xsl:if test="MemberType = 'Event'">
448 <xsl:text>event </xsl:text>
450 <xsl:if test="ReturnValue/ReturnType=''">
451 <xsl:value-of select="substring-before(substring-after(MemberSignature[@Language='C#']/@Value, 'event '), concat(' ', @MemberName))"/>
455 <!-- return value (comes out "" where not applicable/available) -->
457 <xsl:when test="@MemberName='op_Implicit'">
458 <xsl:text>implicit operator</xsl:text>
460 <xsl:when test="@MemberName='op_Explicit'">
461 <xsl:text>explicit operator</xsl:text>
464 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink">
465 <xsl:with-param name="wrt" select="$TypeNamespace"/>
466 </xsl:apply-templates>
471 <xsl:value-of select="' '"/>
476 <!-- Constructors get the name of the class -->
477 <xsl:when test="MemberType='Constructor'">
479 <xsl:call-template name="GetConstructorName">
480 <xsl:with-param name="type" select="../.." />
481 <xsl:with-param name="ctor" select="." />
486 <!-- Conversion operators get the return type -->
487 <xsl:when test="@MemberName='op_Implicit' or @MemberName='op_Explicit'">
488 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink">
489 <xsl:with-param name="wrt" select="$TypeNamespace"/>
490 </xsl:apply-templates>
493 <!-- Regular operators get their symbol -->
494 <xsl:when test="@MemberName='op_UnaryPlus'">operator+</xsl:when>
495 <xsl:when test="@MemberName='op_UnaryNegation'">operator-</xsl:when>
496 <xsl:when test="@MemberName='op_LogicalNot'">operator!</xsl:when>
497 <xsl:when test="@MemberName='op_OnesComplement'">operator~</xsl:when>
498 <xsl:when test="@MemberName='op_Increment'">operator++</xsl:when>
499 <xsl:when test="@MemberName='op_Decrement'">operator--</xsl:when>
500 <xsl:when test="@MemberName='op_True'">operator true</xsl:when>
501 <xsl:when test="@MemberName='op_False'">operator false</xsl:when>
502 <xsl:when test="@MemberName='op_Addition'">operator+</xsl:when>
503 <xsl:when test="@MemberName='op_Subtraction'">operator-</xsl:when>
504 <xsl:when test="@MemberName='op_Multiply'">operator*</xsl:when>
505 <xsl:when test="@MemberName='op_Division'">operator/</xsl:when>
506 <xsl:when test="@MemberName='op_Modulus'">operator%</xsl:when>
507 <xsl:when test="@MemberName='op_BitwiseAnd'">operator&</xsl:when>
508 <xsl:when test="@MemberName='op_BitwiseOr'">operator|</xsl:when>
509 <xsl:when test="@MemberName='op_ExclusiveOr'">operator^</xsl:when>
510 <xsl:when test="@MemberName='op_LeftShift'">operator<<</xsl:when>
511 <xsl:when test="@MemberName='op_RightShift'">operator>></xsl:when>
512 <xsl:when test="@MemberName='op_Equality'">operator==</xsl:when>
513 <xsl:when test="@MemberName='op_Inequality'">operator!=</xsl:when>
514 <xsl:when test="@MemberName='op_GreaterThan'">operator></xsl:when>
515 <xsl:when test="@MemberName='op_LessThan'">operator<</xsl:when>
516 <xsl:when test="@MemberName='op_GreaterThanOrEqual'">operator>=</xsl:when>
517 <xsl:when test="@MemberName='op_LessThanOrEqual'">operator<=</xsl:when>
519 <xsl:when test="MemberType='Property' and count(Parameters/Parameter) > 0">
520 <!-- C# only permits indexer properties to have arguments -->
521 <xsl:text>this</xsl:text>
524 <!-- Everything else just gets its name -->
525 <xsl:when test="contains (@MemberName, '<')">
527 <xsl:call-template name="GetDefinitionName">
528 <xsl:with-param name="name" select="@MemberName" />
529 <xsl:with-param name="TypeParameters" select="TypeParameters" />
535 <b><xsl:value-of select="@MemberName"/></b>
540 <xsl:value-of select="' '"/>
542 <!-- argument list -->
543 <xsl:if test="MemberType='Method' or MemberType='Constructor' or (MemberType='Property' and count(Parameters/Parameter))">
544 <xsl:if test="not(MemberType='Property')">(</xsl:if>
545 <xsl:if test="MemberType='Property'">[</xsl:if>
547 <xsl:for-each select="Parameters/Parameter">
548 <xsl:call-template name="ShowParameter">
549 <xsl:with-param name="Param" select="."/>
550 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
553 <xsl:if test="not(position()=last())">, </xsl:if>
555 <xsl:if test="not(MemberType='Property')">)</xsl:if>
556 <xsl:if test="MemberType='Property'">]</xsl:if>
559 <xsl:if test="MemberType='Property'">
560 <xsl:value-of select="' '"/>
561 <xsl:text>{</xsl:text>
562 <xsl:value-of select="substring-before(substring-after(MemberSignature[@Language='C#']/@Value, '{'), '}')"/>
563 <xsl:text>}</xsl:text>
565 <xsl:call-template name="CreateGenericConstraints">
566 <xsl:with-param name="TypeParameters" select="TypeParameters" />
573 <xsl:template name="GetConstructorName">
574 <xsl:param name="type" />
575 <xsl:param name="ctor" />
578 <xsl:when test="contains($type/@Name, '<')">
579 <xsl:value-of select="translate (substring-before ($type/@Name, '<'), '+', '.')" />
582 <xsl:value-of select="translate ($type/@Name, '+', '.')" />
587 <xsl:template name="ShowParameter">
588 <xsl:param name="Param"/>
589 <xsl:param name="TypeNamespace"/>
590 <xsl:param name="prototype" select="false()"/>
592 <xsl:if test="not($prototype)">
593 <xsl:for-each select="$Param/Attributes/Attribute[not(Exclude='1') and not(AttributeName='ParamArrayAttribute' or AttributeName='System.ParamArray')]">
594 <xsl:text>[</xsl:text>
595 <xsl:value-of select="AttributeName"/>
596 <xsl:text>]</xsl:text>
597 <xsl:value-of select="' '"/>
601 <xsl:if test="count($Param/Attributes/Attribute/AttributeName[.='ParamArrayAttribute' or .='System.ParamArray'])">
603 <xsl:value-of select="' '"/>
606 <xsl:if test="$Param/@RefType">
607 <i><xsl:value-of select="$Param/@RefType"/></i>
609 <xsl:value-of select="' '"/>
612 <!-- parameter type link -->
613 <xsl:apply-templates select="$Param/@Type" mode="typelink">
614 <xsl:with-param name="wrt" select="$TypeNamespace"/>
615 </xsl:apply-templates>
617 <xsl:if test="not($prototype)">
619 <xsl:value-of select="' '"/>
621 <!-- parameter name -->
622 <xsl:value-of select="$Param/@Name"/>
626 <xsl:template name="DisplayDocsInformation">
627 <xsl:param name="linkid" />
629 <!-- The namespace that the current type belongs to. -->
630 <xsl:variable name="TypeNamespace" select="substring(@FullName, 1, string-length(@FullName) - string-length(@Name) - 1)"/>
632 <!-- alt member: not sure what these are for, actually -->
634 <xsl:if test="count(Docs/altmember)">
635 <xsl:call-template name="CreateH4Section">
636 <xsl:with-param name="name" select="'See Also'"/>
637 <xsl:with-param name="child-id" select="concat ($linkid, ':See Also')" />
638 <xsl:with-param name="content">
639 <xsl:for-each select="Docs/altmember">
640 <div><xsl:apply-templates select="@cref" mode="cref"/></div>
646 <!-- parameters & return & value -->
648 <xsl:if test="count(Docs/typeparam)">
649 <xsl:call-template name="CreateH4Section">
650 <xsl:with-param name="name" select="'Type Parameters'"/>
651 <xsl:with-param name="child-id" select="concat ($linkid, ':Type Parameters')" />
652 <xsl:with-param name="content">
654 <xsl:for-each select="Docs/typeparam">
655 <dt><i><xsl:value-of select="@name"/></i></dt>
657 <xsl:apply-templates select="." mode="notoppara"/>
658 <xsl:apply-templates select="." mode="editlink"/>
665 <xsl:if test="count(Docs/param)">
666 <xsl:call-template name="CreateH4Section">
667 <xsl:with-param name="name" select="'Parameters'"/>
668 <xsl:with-param name="child-id" select="concat ($linkid, ':Parameters')" />
669 <xsl:with-param name="content">
671 <xsl:for-each select="Docs/param">
672 <dt><i><xsl:value-of select="@name"/></i></dt>
674 <xsl:apply-templates select="." mode="notoppara"/>
675 <xsl:apply-templates select="." mode="editlink"/>
682 <xsl:if test="count(Docs/returns)">
683 <xsl:call-template name="CreateH4Section">
684 <xsl:with-param name="name" select="'Returns'"/>
685 <xsl:with-param name="child-id" select="concat ($linkid, ':Returns')" />
686 <xsl:with-param name="content">
687 <xsl:apply-templates select="Docs/returns" mode="notoppara"/>
688 <xsl:apply-templates select="Docs/returns" mode="editlink"/>
692 <xsl:if test="count(Docs/value)">
693 <xsl:call-template name="CreateH4Section">
694 <xsl:with-param name="name" select="'Value'"/>
695 <xsl:with-param name="child-id" select="concat ($linkid, ':Value')" />
696 <xsl:with-param name="content">
697 <xsl:apply-templates select="Docs/value" mode="notoppara"/>
698 <xsl:apply-templates select="Docs/value" mode="editlink"/>
703 <!-- method/property/constructor exceptions -->
705 <xsl:if test="count(Docs/exception)">
706 <xsl:call-template name="CreateH4Section">
707 <xsl:with-param name="name" select="'Exceptions'"/>
708 <xsl:with-param name="child-id" select="concat ($linkid, ':Exceptions')" />
709 <xsl:with-param name="content">
710 <xsl:call-template name="CreateTypeDocumentationTable">
711 <xsl:with-param name="content">
712 <xsl:for-each select="Docs/exception">
715 <xsl:apply-templates select="@cref" mode="typelink">
716 <xsl:with-param name="wrt" select="$TypeNamespace"/>
717 </xsl:apply-templates>
720 <xsl:apply-templates select="." mode="notoppara"/>
721 <xsl:apply-templates select="." mode="editlink"/>
733 <xsl:if test="count(Docs/remarks)">
734 <xsl:call-template name="CreateH2Section">
735 <xsl:with-param name="name" select="'Remarks'"/>
736 <xsl:with-param name="child-id" select="concat ($linkid, ':Remarks')" />
737 <xsl:with-param name="content">
738 <xsl:apply-templates select="Docs/remarks" mode="notoppara"/>
739 <xsl:apply-templates select="Docs/remarks" mode="editlink"/>
744 <!-- thread safety -->
746 <xsl:if test="count(ThreadingSafetyStatement)">
747 <xsl:call-template name="CreateH2Section">
748 <xsl:with-param name="name" select="'Thread Safety'"/>
749 <xsl:with-param name="child-id" select="concat ($linkid, ':Thread Safety')" />
750 <xsl:with-param name="content">
751 <xsl:apply-templates select="ThreadingSafetyStatement" mode="notoppara"/>
759 <xsl:if test="count(Docs/permission)">
760 <xsl:call-template name="CreateH2Section">
761 <xsl:with-param name="name" select="'Permissions'"/>
762 <xsl:with-param name="child-id" select="concat ($linkid, ':Permissions')" />
763 <xsl:with-param name="content">
764 <xsl:call-template name="CreateTypeDocumentationTable">
765 <xsl:with-param name="content">
766 <xsl:for-each select="Docs/permission">
769 <xsl:apply-templates select="@cref" mode="typelink">
770 <xsl:with-param name="wrt" select="$TypeNamespace"/>
771 </xsl:apply-templates>
772 <xsl:apply-templates select="." mode="editlink"/>
775 <xsl:apply-templates select="." mode="notoppara"/>
785 <!-- enumeration values -->
787 <xsl:if test="Base/BaseTypeName = 'System.Enum'">
788 <xsl:call-template name="CreateH2Section">
789 <xsl:with-param name="name" select="'Members'"/>
790 <xsl:with-param name="child-id" select="concat ($linkid, ':Members')" />
791 <xsl:with-param name="content">
792 <xsl:call-template name="CreateEnumerationTable">
793 <xsl:with-param name="content">
795 <xsl:for-each select="Members/Member[MemberType='Field']">
796 <xsl:if test="not(@MemberName='value__')">
797 <tr valign="top"><td>
798 <xsl:attribute name="id">
799 <xsl:text>F:</xsl:text>
800 <xsl:value-of select="translate (/Type/@FullName, '+', '.')" />
801 <xsl:text>.</xsl:text>
802 <xsl:value-of select="@MemberName" />
805 <xsl:value-of select="@MemberName"/>
809 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
810 <xsl:apply-templates select="Docs/summary" mode="editlink"/>
823 <xsl:if test="count(Docs/example)">
824 <xsl:for-each select="Docs/example">
825 <xsl:call-template name="CreateH2Section">
826 <xsl:with-param name="name" select="'Example'"/>
827 <xsl:with-param name="child-id" select="concat ($linkid, ':Example:', position())" />
828 <xsl:with-param name="content">
829 <xsl:apply-templates select="." mode="notoppara"/>
835 <!-- related content -->
836 <xsl:if test="count(Docs/related)">
837 <xsl:call-template name="CreateH2Section">
838 <xsl:with-param name="name" select="'Related content'" />
839 <xsl:with-param name="child-id" select="concat ($linkid, ':Related:')" />
840 <xsl:with-param name="content">
841 <div class="related">
842 <xsl:call-template name="CreateRelatedSection">
843 <xsl:with-param name="section" select="'Platform Docs'" />
844 <xsl:with-param name="type" select="'PlatformDocAPI'" />
846 <xsl:call-template name="CreateRelatedSection">
847 <xsl:with-param name="section" select="'Articles'" />
848 <xsl:with-param name="type" select="'article'" />
850 <xsl:call-template name="CreateRelatedSection">
851 <xsl:with-param name="section" select="'Recipes'" />
852 <xsl:with-param name="type" select="'recipe'" />
854 <xsl:call-template name="CreateRelatedSection">
855 <xsl:with-param name="section" select="'Samples'" />
856 <xsl:with-param name="type" select="'sample'" />
858 <xsl:call-template name="CreateRelatedSection">
859 <xsl:with-param name="section" select="'Related specifications'" />
860 <xsl:with-param name="type" select="'specification'" />
862 <xsl:call-template name="CreateRelatedSection">
863 <xsl:with-param name="section" select="'External Documentation'" />
864 <xsl:with-param name="type" select="'externalDocumentation'" />
871 <xsl:call-template name="CreateH2Section">
872 <xsl:with-param name="name" select="'Requirements'"/>
873 <xsl:with-param name="child-id" select="concat ($linkid, ':Version Information')" />
874 <xsl:with-param name="content">
875 <xsl:call-template name="CreatePlatformRequirements" />
876 <b>Namespace: </b><xsl:value-of select="substring(/Type/@FullName, 1, string-length(/Type/@FullName) - string-length(/Type/@Name) - 1)" />
877 <xsl:if test="count(/Type/AssemblyInfo/AssemblyName) > 0">
880 <xsl:value-of select="/Type/AssemblyInfo/AssemblyName" />
881 <xsl:text> (in </xsl:text>
882 <xsl:value-of select="/Type/AssemblyInfo/AssemblyName" />
883 <xsl:text>.dll)</xsl:text>
885 <xsl:if test="count(AssemblyInfo/AssemblyVersion) > 0">
887 <b>Assembly Versions: </b>
888 <xsl:for-each select="AssemblyInfo/AssemblyVersion">
889 <xsl:if test="not(position()=1)">, </xsl:if>
890 <xsl:value-of select="."/>
893 <xsl:if test="count(Docs/since) > 0">
896 <xsl:for-each select="Docs/since">
897 <xsl:if test="not(position()=1)">; </xsl:if>
898 <xsl:value-of select="@version"/>
901 <xsl:if test="count(Docs/since)=0 and count(/Type/Docs/since) > 0">
904 <xsl:for-each select="/Type/Docs/since">
905 <xsl:if test="not(position()=1)">; </xsl:if>
906 <xsl:value-of select="@version"/>
914 <!-- Transforms the contents of the selected node into a hyperlink to the type named by the node. The node can contain a type name (eg System.Object) or a type link (eg T:System.String). Use wrt parameter to specify the current namespace. -->
916 <xsl:template match="*|@*" mode="typelink">
917 <xsl:param name="wrt" select="'notset'"/>
919 <xsl:call-template name="maketypelink">
920 <xsl:with-param name="type" select="."/>
921 <xsl:with-param name="wrt" select="$wrt"/>
925 <xsl:template name="makenamespacelink">
926 <xsl:param name="cref" select="''"/>
929 <xsl:attribute name="href">
930 <xsl:call-template name="GetLinkTargetHtml">
931 <xsl:with-param name="cref" select="$cref" />
935 <xsl:value-of select="substring-after ($cref, 'N:')" />
939 <xsl:template name="maketypelink">
940 <xsl:param name="type" select="'notset'"/>
941 <xsl:param name="wrt" select="'notset'"/>
942 <xsl:param name="nested" select="0"/>
944 <xsl:variable name="btype">
945 <xsl:call-template name="ToBrackets">
946 <xsl:with-param name="s" select="$type" />
950 <xsl:variable name="array">
951 <xsl:call-template name="GetArraySuffix">
952 <xsl:with-param name="type" select="$type" />
959 <xsl:when test="starts-with($type, 'T:')">
960 <xsl:call-template name="maketypelink">
961 <xsl:with-param name="type" select="substring($type, 3)"/>
962 <xsl:with-param name="wrt" select="$wrt"/>
966 <xsl:when test="contains ($type, '&') and
967 '&' = substring ($type, string-length ($type), 1)">
968 <xsl:call-template name="maketypelink">
969 <xsl:with-param name="type" select="substring($type, 1, string-length($type)-1)"/>
970 <xsl:with-param name="wrt" select="$wrt"/>
974 <xsl:when test="string($array)">
975 <xsl:call-template name="maketypelink">
976 <xsl:with-param name="type" select="substring($type, 1, string-length($type) - string-length ($array))"/>
977 <xsl:with-param name="wrt" select="$wrt"/>
979 <xsl:value-of select="$array"/>
982 <xsl:when test="contains ($type, '*') and
983 '*' = substring ($type, string-length ($type), 1)">
984 <xsl:call-template name="maketypelink">
985 <xsl:with-param name="type" select="substring($type, 1, string-length($type)-1)"/>
986 <xsl:with-param name="wrt" select="$wrt"/>
988 <xsl:value-of select="'*'"/>
991 <!-- if this is a generic type parameter, don't make a link but italicize it and give it a tooltip instead -->
992 <xsl:when test="count($ThisType/TypeParameters/TypeParameter[@Name=$type] |
993 $ThisType/TypeParameters/TypeParameter[child::text()=$type] |
994 ancestor::Member/Docs/typeparam[@name=$type]) = 1">
995 <!-- note that we check if it is a generic type using /Type/TypeParameters because that will have type parameters declared in an outer class if this is a nested class, but then we get the tooltip text from the type parameters documented in this file -->
996 <i title="{$ThisType/Docs/typeparam[@name=$type] | ancestor::Member/Docs/typeparam[@name=$type]}"><xsl:value-of select="$type"/></i>
999 <!-- if this is a generic type parameter of a base type, replace it with the type that it was instantiated with -->
1000 <xsl:when test="count(ancestor::Members/BaseTypeArgument[@TypeParamName=$type]) = 1">
1001 <!-- note that an overridden type parameter may be referenced in a type parameter within $type, but we can't replace that nicely since we can't parse generic type names here -->
1002 <xsl:call-template name="maketypelink">
1003 <xsl:with-param name="type" select="ancestor::Members/BaseTypeArgument[@TypeParamName=$type]"/>
1004 <xsl:with-param name="wrt" select="$wrt"/>
1005 </xsl:call-template>
1010 <xsl:variable name="escaped-type">
1011 <xsl:call-template name="GetEscapedTypeName">
1012 <xsl:with-param name="typename" select="$btype" />
1013 </xsl:call-template>
1016 <xsl:attribute name="href">
1017 <xsl:call-template name="GetLinkTargetHtml">
1018 <xsl:with-param name="type" select="$escaped-type" />
1019 <xsl:with-param name="cref" select="concat ('T:', $escaped-type)" />
1020 </xsl:call-template>
1023 <xsl:call-template name="GetTypeDisplayName">
1024 <xsl:with-param name="T" select="$btype"/>
1025 <xsl:with-param name="wrt" select="$wrt"/>
1026 </xsl:call-template>
1032 <xsl:template name="GetArraySuffix">
1033 <xsl:param name="type" />
1035 <xsl:if test="contains ($type, ']') and
1036 ']' = substring ($type, string-length ($type), 1)">
1037 <xsl:variable name="start">
1038 <xsl:call-template name="GetArraySuffixStart">
1039 <xsl:with-param name="type" select="$type" />
1040 <xsl:with-param name="i" select="string-length ($type) - 1" />
1041 </xsl:call-template>
1043 <xsl:value-of select="substring ($type, $start)" />
1047 <xsl:template name="GetArraySuffixStart">
1048 <xsl:param name="type" />
1049 <xsl:param name="i" />
1052 <xsl:when test="substring ($type, $i, 1) = '['">
1053 <xsl:value-of select="$i" />
1056 <xsl:call-template name="GetArraySuffixStart">
1057 <xsl:with-param name="type" select="$type" />
1058 <xsl:with-param name="i" select="$i - 1" />
1059 </xsl:call-template>
1064 <xsl:template name="GetTypeDisplayName">
1065 <xsl:param name="T"/>
1066 <xsl:param name="wrt"/>
1068 <!-- use C#-style names -->
1070 <xsl:when test="$T='System.Object'">object</xsl:when>
1071 <xsl:when test="$T='System.Boolean'">bool</xsl:when>
1072 <xsl:when test="$T='System.Byte'">byte</xsl:when>
1073 <xsl:when test="$T='System.Char'">char</xsl:when>
1074 <xsl:when test="$T='System.Decimal'">decimal</xsl:when>
1075 <xsl:when test="$T='System.Double'">double</xsl:when>
1076 <xsl:when test="$T='System.Int16'">short</xsl:when>
1077 <xsl:when test="$T='System.Int32'">int</xsl:when>
1078 <xsl:when test="$T='System.Int64'">long</xsl:when>
1079 <xsl:when test="$T='System.SByte'">sbyte</xsl:when>
1080 <xsl:when test="$T='System.Single'">float</xsl:when>
1081 <xsl:when test="$T='System.String'">string</xsl:when>
1082 <xsl:when test="$T='System.UInt16'">ushort</xsl:when>
1083 <xsl:when test="$T='System.UInt32'">uint</xsl:when>
1084 <xsl:when test="$T='System.UInt64'">ulong</xsl:when>
1085 <xsl:when test="$T='System.Void'">void</xsl:when>
1087 <xsl:when test="contains($T, '<')">
1088 <xsl:call-template name="GetTypeDisplayName">
1089 <xsl:with-param name="T" select="substring-before ($T, '<')" />
1090 <xsl:with-param name="wrt" select="$wrt" />
1091 </xsl:call-template>
1092 <xsl:text><</xsl:text>
1093 <xsl:call-template name="GetMemberArgList">
1094 <xsl:with-param name="arglist" select="substring-after ($T, '<')" />
1095 <xsl:with-param name="wrt" select="$wrt" />
1096 </xsl:call-template>
1097 <!-- don't need to append > as GetMemberArgList (eventually) appends it -->
1100 <!-- if the type is in the wrt namespace, omit the namespace name -->
1101 <xsl:when test="not($wrt='') and starts-with($T, concat($wrt,'.')) and not(contains(substring-after($T,concat($wrt,'.')), '.'))">
1102 <xsl:value-of select="translate (substring-after($T,concat($wrt,'.')), '+', '.')"/>
1105 <!-- if the type is in the System namespace, omit the namespace name -->
1106 <xsl:when test="starts-with($T, 'System.') and not(contains(substring-after($T, 'System.'), '.'))">
1107 <xsl:value-of select="translate (substring-after($T,'System.'), '+', '.')"/>
1110 <!-- if the type is in the System.Collections namespace, omit the namespace name -->
1111 <xsl:when test="starts-with($T, 'System.Collections.') and not(contains(substring-after($T, 'System.Collections.'), '.'))">
1112 <xsl:value-of select="translate (substring-after($T,'System.Collections.'), '+', '.')"/>
1115 <!-- if the type is in the System.Collections.Generic namespace, omit the namespace name -->
1116 <xsl:when test="starts-with($T, 'System.Collections.Generic.') and not(contains(substring-after($T, 'System.Collections.Generic.'), '.'))">
1117 <xsl:value-of select="translate (substring-after($T,'System.Collections.Generic.'), '+', '.')"/>
1121 <xsl:value-of select="translate ($T, '+', '.')" />
1126 <xsl:template name="GetMemberDisplayName">
1127 <xsl:param name="memberName" />
1128 <xsl:param name="isproperty" select="false()" />
1131 <xsl:when test="contains($memberName, '.')">
1132 <xsl:call-template name="GetTypeDisplayName">
1133 <xsl:with-param name="T">
1134 <xsl:call-template name="GetTypeName">
1135 <xsl:with-param name="type" select="$memberName"/>
1136 </xsl:call-template>
1138 <xsl:with-param name="wrt" select="''" />
1139 </xsl:call-template>
1140 <xsl:text>.</xsl:text>
1141 <xsl:call-template name="GetMemberName">
1142 <xsl:with-param name="type" select="$memberName" />
1143 <xsl:with-param name="isproperty" select="$isproperty"/>
1144 </xsl:call-template>
1147 <xsl:value-of select="$memberName" />
1152 <xsl:template name="ToBrackets">
1153 <xsl:param name="s" />
1154 <xsl:value-of select="translate (translate ($s, '{', '<'), '}', '>')" />
1157 <xsl:template name="ToBraces">
1158 <xsl:param name="s" />
1159 <xsl:value-of select="translate (translate ($s, '<', '{'), '>', '}')" />
1162 <xsl:template name="memberlinkprefix">
1163 <xsl:param name="member" />
1165 <xsl:when test="$member/MemberType='Constructor'">C</xsl:when>
1166 <xsl:when test="$member/MemberType='Method'">M</xsl:when>
1167 <xsl:when test="$member/MemberType='Property'">P</xsl:when>
1168 <xsl:when test="$member/MemberType='Field'">F</xsl:when>
1169 <xsl:when test="$member/MemberType='Event'">E</xsl:when>
1173 <xsl:template name="makememberlink">
1174 <xsl:param name="cref"/>
1176 <xsl:variable name="bcref">
1177 <xsl:call-template name="ToBrackets">
1178 <xsl:with-param name="s" select="$cref" />
1179 </xsl:call-template>
1182 <xsl:variable name="fullname">
1184 <xsl:when test="starts-with($bcref, 'C:') or starts-with($bcref, 'T:')">
1186 <xsl:when test="contains($bcref, '(')">
1187 <xsl:value-of select="substring (substring-before ($bcref, '('), 3)" />
1190 <xsl:value-of select="substring($bcref, 3)" />
1195 <xsl:call-template name="GetTypeName">
1196 <xsl:with-param name="type" select="substring($bcref, 3)"/>
1197 </xsl:call-template>
1202 <xsl:variable name="memberName">
1204 <xsl:when test="starts-with($bcref, 'T:')" />
1205 <xsl:when test="starts-with($bcref, 'C:') and not(contains($bcref, '('))" />
1206 <xsl:when test="starts-with($bcref, 'C:') and contains($bcref, '(')">
1207 <xsl:text>(</xsl:text>
1208 <xsl:call-template name="GetMemberArgList">
1209 <xsl:with-param name="arglist" select="substring-before(substring-after($bcref, '('), ')')" />
1210 <xsl:with-param name="wrt" select="$TypeNamespace" />
1211 </xsl:call-template>
1212 <xsl:text>)</xsl:text>
1215 <xsl:text>.</xsl:text>
1216 <xsl:call-template name="GetMemberName">
1217 <xsl:with-param name="type" select="substring($bcref, 3)" />
1218 <xsl:with-param name="wrt" select="$fullname"/>
1219 <xsl:with-param name="isproperty" select="starts-with($bcref, 'P:')"/>
1220 </xsl:call-template>
1225 <xsl:variable name="escaped-type">
1226 <xsl:call-template name="GetEscapedTypeName">
1227 <xsl:with-param name="typename">
1228 <xsl:call-template name="ToBrackets">
1229 <xsl:with-param name="s" select="$fullname" />
1230 </xsl:call-template>
1232 </xsl:call-template>
1234 <xsl:variable name="displayname">
1235 <xsl:call-template name="GetTypeDisplayName">
1236 <xsl:with-param name="T" select="$fullname" />
1237 <xsl:with-param name="wrt" select="$TypeNamespace"/>
1238 </xsl:call-template>
1241 <xsl:attribute name="href">
1242 <xsl:call-template name="GetLinkTargetHtml">
1243 <xsl:with-param name="type" select="$escaped-type" />
1244 <xsl:with-param name="cref">
1245 <xsl:call-template name="ToBraces">
1246 <xsl:with-param name="s" select="$cref" />
1247 </xsl:call-template>
1249 </xsl:call-template>
1251 <xsl:value-of select="translate (concat($displayname, $memberName), '+', '.')" />
1255 <xsl:template name="GetTypeName">
1256 <xsl:param name="type" />
1257 <xsl:variable name="prefix" select="substring-before($type, '.')" />
1258 <xsl:variable name="suffix" select="substring-after($type, '.')" />
1260 <xsl:when test="contains($type, '(')">
1261 <xsl:call-template name="GetTypeName">
1262 <xsl:with-param name="type" select="substring-before($type, '(')" />
1263 </xsl:call-template>
1265 <xsl:when test="not(contains($suffix, '.'))">
1266 <xsl:value-of select="$prefix" />
1269 <xsl:value-of select="$prefix" />
1270 <xsl:text>.</xsl:text>
1271 <xsl:call-template name="GetTypeName">
1272 <xsl:with-param name="type" select="$suffix" />
1273 </xsl:call-template>
1278 <xsl:template name="GetMemberName">
1279 <xsl:param name="type" />
1280 <xsl:param name="isproperty" select="0"/>
1281 <xsl:variable name="prefix" select="substring-before($type, '.')" />
1282 <xsl:variable name="suffix" select="substring-after($type, '.')" />
1284 <xsl:when test="contains($type, '(')">
1285 <xsl:call-template name="GetMemberName">
1286 <xsl:with-param name="type" select="substring-before($type, '(')" />
1287 </xsl:call-template>
1288 <xsl:text>(</xsl:text>
1289 <xsl:call-template name="GetMemberArgList">
1290 <xsl:with-param name="arglist" select="substring-before(substring-after($type, '('), ')')" />
1291 <xsl:with-param name="wrt" select="$TypeNamespace" />
1292 </xsl:call-template>
1293 <xsl:text>)</xsl:text>
1295 <xsl:when test="not(contains($suffix, '.'))">
1296 <xsl:value-of select="$suffix" />
1299 <xsl:call-template name="GetMemberName">
1300 <xsl:with-param name="type" select="$suffix" />
1301 </xsl:call-template>
1306 <xsl:template name="GetMemberArgList">
1307 <xsl:param name="arglist" />
1308 <xsl:param name="wrt" select="''"/>
1310 <xsl:variable name="_arglist">
1312 <xsl:when test="starts-with ($arglist, ',')">
1313 <xsl:value-of select="substring-after ($arglist, ',')" />
1316 <xsl:value-of select="$arglist" />
1321 <xsl:if test="starts-with ($arglist, ',')">
1322 <xsl:text>, </xsl:text>
1325 <xsl:variable name="c" select="substring-before ($_arglist, ',')" />
1326 <xsl:variable name="lt" select="substring-before ($_arglist, '<')" />
1327 <xsl:variable name="gt" select="substring-before ($_arglist, '>')" />
1330 <!-- Need to insert ',' between type arguments -->
1332 ($c != '' and $lt != '' and $gt != '' and
1333 string-length ($c) < string-length ($lt) and
1334 string-length ($c) < string-length ($gt)) or
1335 ($c != '' and $lt != '' and $gt = '' and
1336 string-length ($c) < string-length ($lt)) or
1337 ($c != '' and $lt = '' and $gt != '' and
1338 string-length ($c) < string-length ($gt)) or
1339 ($c != '' and $lt = '' and $gt = '')">
1340 <xsl:call-template name="GetTypeDisplayName">
1341 <xsl:with-param name="T" select="$c"/>
1342 <xsl:with-param name="wrt" select="$wrt"/>
1343 </xsl:call-template>
1344 <xsl:text>, </xsl:text>
1345 <xsl:call-template name="GetMemberArgList">
1346 <xsl:with-param name="arglist" select="substring-after($_arglist, ',')" />
1347 <xsl:with-param name="wrt" select="$wrt" />
1348 </xsl:call-template>
1351 <!-- start of nested type argument list < -->
1353 ($c != '' and $lt != '' and $gt != '' and
1354 string-length ($lt) < string-length ($c) and
1355 string-length ($lt) < string-length ($gt)) or
1356 ($c != '' and $lt != '' and $gt = '' and
1357 string-length ($lt) < string-length ($c)) or
1358 ($c = '' and $lt != '' and $gt != '' and
1359 string-length ($lt) < string-length ($gt))">
1360 <xsl:call-template name="GetTypeDisplayName">
1361 <xsl:with-param name="T" select="$lt"/>
1362 <xsl:with-param name="wrt" select="$wrt"/>
1363 </xsl:call-template>
1364 <xsl:text><</xsl:text>
1365 <xsl:call-template name="GetMemberArgList">
1366 <xsl:with-param name="arglist" select="substring-after($_arglist, '<')" />
1367 <xsl:with-param name="wrt" select="$wrt" />
1368 </xsl:call-template>
1371 <!-- end of (nested?) type argument list > -->
1373 ($c != '' and $lt != '' and $gt != '' and
1374 string-length ($gt) < string-length ($c) and
1375 string-length ($gt) < string-length ($lt)) or
1376 ($c != '' and $lt = '' and $gt = '' and
1377 string-length ($gt) < string-length ($c)) or
1378 ($c = '' and $lt != '' and $gt != '' and
1379 string-length ($gt) < string-length ($lt)) or
1380 ($c = '' and $lt = '' and $gt != '')">
1381 <xsl:call-template name="GetTypeDisplayName">
1382 <xsl:with-param name="T" select="$gt"/>
1383 <xsl:with-param name="wrt" select="$wrt"/>
1384 </xsl:call-template>
1385 <xsl:text>></xsl:text>
1386 <xsl:call-template name="GetMemberArgList">
1387 <xsl:with-param name="arglist" select="substring-after($_arglist, '>')" />
1388 <xsl:with-param name="wrt" select="$wrt" />
1389 </xsl:call-template>
1392 <!-- nothing left to do -->
1394 <xsl:call-template name="GetTypeDisplayName">
1395 <xsl:with-param name="T" select="$_arglist"/>
1396 <xsl:with-param name="wrt" select="$wrt"/>
1397 </xsl:call-template>
1402 <!-- Transforms the contents of the selected node containing a cref into a hyperlink. -->
1403 <xsl:template match="*|@*" mode="cref">
1404 <xsl:call-template name="makememberlink">
1405 <xsl:with-param name="cref" select="."/>
1406 </xsl:call-template>
1409 <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
1410 <xsl:value-of select="substring-after(., ':')"/></a>
1414 <xsl:template name="membertypeplural">
1415 <xsl:param name="name"/>
1417 <xsl:when test="$name='ExtensionMethod'">Extension Methods</xsl:when>
1418 <xsl:when test="$name='Constructor'">Constructors</xsl:when>
1419 <xsl:when test="$name='Property'">Properties</xsl:when>
1420 <xsl:when test="$name='Method'">Methods</xsl:when>
1421 <xsl:when test="$name='Field'">Fields</xsl:when>
1422 <xsl:when test="$name='Event'">Events</xsl:when>
1423 <xsl:when test="$name='Operator'">Operators</xsl:when>
1424 <xsl:when test="$name='Explicit'">Explicitly Implemented Interface Members</xsl:when>
1427 <xsl:template name="membertypeplurallc">
1428 <xsl:param name="name"/>
1430 <xsl:when test="$name='ExtensionMethod'">extension methods</xsl:when>
1431 <xsl:when test="$name='Constructor'">constructors</xsl:when>
1432 <xsl:when test="$name='Property'">properties</xsl:when>
1433 <xsl:when test="$name='Method'">methods</xsl:when>
1434 <xsl:when test="$name='Field'">fields</xsl:when>
1435 <xsl:when test="$name='Event'">events</xsl:when>
1436 <xsl:when test="$name='Operator'">operators</xsl:when>
1437 <xsl:when test="$name='Explicit'">explicitly implemented interface members</xsl:when>
1440 <xsl:template name="gettypetype">
1441 <xsl:variable name="sig" select="concat(' ', TypeSignature[@Language='C#']/@Value, ' ')"/>
1443 <xsl:when test="contains($sig,'class')">Class</xsl:when>
1444 <xsl:when test="contains($sig,'enum')">Enumeration</xsl:when>
1445 <xsl:when test="contains($sig,'struct')">Structure</xsl:when>
1446 <xsl:when test="contains($sig,'delegate')">Delegate</xsl:when>
1450 <!-- Ensures that the resuting node is not surrounded by a para tag. -->
1451 <xsl:template match="*|@*" mode="editlink">
1452 <xsl:call-template name="CreateEditLink">
1453 <xsl:with-param name="e" select="." />
1454 </xsl:call-template>
1457 <xsl:template match="*" mode="notoppara">
1459 <xsl:when test="starts-with (string(.), 'To be added')">
1460 <span class="NotEntered">Documentation for this section has not yet been entered.</span>
1462 <xsl:when test="count(*) = 1 and count(para)=1">
1463 <xsl:apply-templates select="para/node()"/>
1466 <xsl:apply-templates select="."/>
1471 <xsl:template match="para">
1473 <xsl:apply-templates/>
1477 <xsl:template match="attribution">
1478 <a href="http://creativecommons.org/licenses/by/4.0/" class="attributionlogo">
1479 <xsl:attribute name="title">
1481 <xsl:when test="@modified='false'"><xsl:value-of select="concat('This content is licensed Creative Commons By ', @from)" /></xsl:when>
1482 <xsl:otherwise><xsl:value-of select="concat('This content has been modified under a Creative Commons license from ', @from)" /></xsl:otherwise>
1485 <img src="mdocimages/creativecommons.png" />
1489 <xsl:template match="paramref">
1490 <i><xsl:value-of select="@name"/>
1491 <xsl:apply-templates/>
1495 <xsl:template match="typeparamref">
1496 <i><xsl:value-of select="@name"/>
1497 <xsl:apply-templates/>
1501 <xsl:template match="block[@type='note']">
1504 <xsl:apply-templates/>
1507 <xsl:template match="block[@type='behaviors']">
1508 <h5 class="Subsection">Operation</h5>
1509 <xsl:apply-templates/>
1511 <xsl:template match="block[@type='overrides']">
1512 <h5 class="Subsection">Note to Inheritors</h5>
1513 <xsl:apply-templates/>
1515 <xsl:template match="block[@type='usage']">
1516 <h5 class="Subsection">Usage</h5>
1517 <xsl:apply-templates/>
1520 <xsl:template match="c">
1522 <xsl:apply-templates/>
1525 <xsl:template match="c//para">
1526 <xsl:apply-templates/><br/>
1529 <xsl:template match="code">
1530 <xsl:call-template name="CreateCodeBlock">
1531 <xsl:with-param name="language" select="@lang" />
1532 <xsl:with-param name="content" select="string(descendant-or-self::text())" />
1533 </xsl:call-template>
1535 <xsl:template match="img">
1538 <xsl:attribute name="src">
1539 <!-- we recognize two types of images:
1540 - those with src attribute that reference directly an external image
1541 - those with a href attributes which are internally available as part of the doc bundle
1544 <xsl:when test="count(@src)>0">
1545 <xsl:value-of select="@src" />
1547 <xsl:when test="count(@href)>0">
1548 <xsl:value-of select="concat('source-id:', $source-id, ':', @href)" />
1552 <xsl:attribute name="class">
1554 <xsl:when test="count(@class)>0">
1555 <xsl:value-of select="@class" />
1557 <xsl:otherwise>picture</xsl:otherwise>
1564 <xsl:template match="onequarter">¼</xsl:template>
1565 <xsl:template match="pi">Ï€</xsl:template>
1566 <xsl:template match="theta">θ</xsl:template>
1567 <xsl:template match="leq">≤</xsl:template>
1568 <xsl:template match="geq">≥</xsl:template>
1569 <xsl:template match="subscript">
1570 <sub><xsl:value-of select="@term"/></sub>
1572 <xsl:template match="superscript">
1573 <sup><xsl:value-of select="@term"/></sup>
1581 <term>First Col Header</term>
1582 <description>Second Col Header</description>
1583 <description>Third Col Header</description>
1586 <term>First Row First Col</term>
1587 <description>First Row Second Col</description>
1588 <description>First Row Third Col</description>
1591 <term>Second Row First Col</term>
1592 <description>Second Row Second Col</description>
1593 <description>Second Row Third Col</description>
1598 <xsl:template match="list[@type='table']">
1599 <xsl:call-template name="CreateListTable">
1600 <xsl:with-param name="header">
1601 <th><xsl:apply-templates select="listheader/term" mode="notoppara"/></th>
1602 <xsl:for-each select="listheader/description">
1603 <th><xsl:apply-templates mode="notoppara"/></th>
1607 <xsl:with-param name="content">
1608 <xsl:for-each select="item">
1611 <xsl:apply-templates select="term" mode="notoppara"/>
1613 <xsl:for-each select="description">
1615 <xsl:apply-templates mode="notoppara"/>
1621 </xsl:call-template>
1624 <xsl:template match="list[@type='bullet']">
1626 <xsl:for-each select="item">
1628 <xsl:apply-templates select="term" mode="notoppara"/>
1629 <xsl:apply-templates select="para" mode="notoppara"/>
1634 <xsl:template match="list[@type='number']">
1636 <xsl:for-each select="item">
1638 <xsl:apply-templates select="term" mode="notoppara"/>
1644 <xsl:template match="list">
1645 [<i>The '<xsl:value-of select="@type"/>' type of list has not been implemented in the ECMA stylesheet.</i>]
1648 [<i>The '<xsl:value-of select="@type"/>' type of list has not been implemented in the ECMA stylesheet.</i>]
1652 <xsl:template match="see[@cref]">
1654 <xsl:when test="not(substring-after(@cref, 'T:')='')">
1655 <xsl:call-template name="maketypelink">
1656 <xsl:with-param name="type" select="normalize-space (@cref)"/>
1657 </xsl:call-template>
1659 <xsl:when test="not(substring-after(@cref, 'N:')='')">
1660 <xsl:call-template name="makenamespacelink">
1661 <xsl:with-param name="cref" select="normalize-space (@cref)"/>
1662 </xsl:call-template>
1665 <xsl:call-template name="makememberlink">
1666 <xsl:with-param name="cref" select="normalize-space (@cref)"/>
1667 </xsl:call-template>
1672 <xsl:template match="see[@langword]">
1673 <tt><xsl:value-of select="@langword"/></tt>
1676 <xsl:template name="GetInheritedMembers">
1677 <xsl:param name="declaringtype"/>
1678 <xsl:param name="generictypereplacements"/>
1679 <xsl:param name="listmembertype"/>
1680 <xsl:param name="showprotected"/>
1681 <xsl:param name="overloads-mode" select="false()" />
1682 <xsl:param name="showstatic" select='1'/>
1685 <xsl:when test="$listmembertype='ExtensionMethod' and $showprotected=false()">
1686 <xsl:for-each select="$declaringtype/Members/Member[MemberType=$listmembertype]">
1687 <Members Name="Link/@Type" FullName="Link/@Type">
1688 <Member MemberName="{@MemberName}">
1689 <xsl:attribute name="ExplicitMemberName">
1690 <xsl:call-template name="GetMemberNameWithoutGenericTypes">
1691 <xsl:with-param name="m" select="@MemberName" />
1692 </xsl:call-template>
1694 <xsl:attribute name="TypeParameters">
1695 <xsl:call-template name="GetTypeParameterNames">
1696 <xsl:with-param name="member" select="." />
1697 </xsl:call-template>
1699 <xsl:attribute name="Parameters">
1700 <xsl:call-template name="GetParameterTypes">
1701 <xsl:with-param name="member" select="." />
1702 </xsl:call-template>
1704 <xsl:copy-of select="./*" />
1710 <Members Name="{$declaringtype/@Name}" FullName="{$declaringtype/@FullName}">
1712 <xsl:copy-of select="$generictypereplacements"/>
1714 <!-- Get all members in this type that are of listmembertype and are either
1715 protected or not protected according to showprotected. -->
1717 <xsl:when test="$listmembertype = 'Explicit'">
1718 <xsl:for-each select="$declaringtype/Members/Member
1719 [MemberType != 'Constructor']
1720 [contains (@MemberName, '.')]">
1721 <Member MemberName="{@MemberName}">
1722 <xsl:attribute name="ExplicitMemberName">
1723 <xsl:call-template name="GetMemberName">
1724 <xsl:with-param name="type" select="@MemberName" />
1725 <xsl:with-param name="isproperty" select="$listmembertype = 'Property'"/>
1726 </xsl:call-template>
1728 <xsl:attribute name="TypeParameters">
1729 <xsl:call-template name="GetTypeParameterNames">
1730 <xsl:with-param name="member" select="." />
1731 </xsl:call-template>
1733 <xsl:attribute name="Parameters">
1734 <xsl:call-template name="GetParameterTypes">
1735 <xsl:with-param name="member" select="." />
1736 </xsl:call-template>
1738 <xsl:copy-of select="./*" />
1743 <xsl:for-each select="$declaringtype/Members/Member
1744 [(MemberType=$listmembertype or ($listmembertype='Operator' and MemberType='Method'))]
1745 [(not($overloads-mode) or @MemberName=$index or
1746 ($index='Conversion' and (@MemberName='op_Implicit' or @MemberName='op_Explicit'))) ]
1747 [$showprotected=starts-with(MemberSignature[@Language='C#']/@Value, 'protected ')]
1748 [($listmembertype='Method' and not(starts-with(@MemberName,'op_')))
1749 or ($listmembertype='Operator' and starts-with(@MemberName,'op_'))
1750 or (not($listmembertype='Method') and not($listmembertype='Operator'))]
1751 [$showstatic or not(contains(MemberSignature[@Language='C#']/@Value,' static '))]
1752 [$listmembertype = 'Constructor' or not(contains(@MemberName, '.'))]
1754 <Member MemberName="{@MemberName}">
1755 <xsl:attribute name="ExplicitMemberName">
1756 <xsl:call-template name="GetMemberNameWithoutGenericTypes">
1757 <xsl:with-param name="m" select="@MemberName" />
1758 </xsl:call-template>
1760 <xsl:attribute name="TypeParameters">
1761 <xsl:call-template name="GetTypeParameterNames">
1762 <xsl:with-param name="member" select="." />
1763 </xsl:call-template>
1765 <xsl:attribute name="Parameters">
1766 <xsl:call-template name="GetParameterTypes">
1767 <xsl:with-param name="member" select="." />
1768 </xsl:call-template>
1770 <xsl:copy-of select="./*" />
1777 <xsl:copy-of select="$declaringtype/Docs/typeparam" />
1784 <xsl:if test="not($listmembertype='Constructor') and count($declaringtype/Base/BaseTypeName)=1">
1785 <xsl:variable name="basedocsfile">
1786 <xsl:call-template name="GetLinkTarget">
1787 <xsl:with-param name="type">
1788 <xsl:call-template name="GetEscapedTypeName">
1789 <xsl:with-param name="typename" select="$declaringtype/Base/BaseTypeName" />
1790 </xsl:call-template>
1792 <xsl:with-param name="cref">
1794 <xsl:with-param name="local-suffix" />
1795 <xsl:with-param name="remote"/>
1796 <xsl:with-param name="xmltarget" select='1'/>
1797 </xsl:call-template>
1800 <xsl:if test="not(string($basedocsfile) = '')">
1801 <xsl:call-template name="GetInheritedMembers">
1802 <xsl:with-param name="listmembertype" select="$listmembertype"/>
1803 <xsl:with-param name="showprotected" select="$showprotected"/>
1804 <xsl:with-param name="declaringtype" select="document(string($basedocsfile),.)/Type"/>
1805 <xsl:with-param name="generictypereplacements" select="$declaringtype/Base/BaseTypeArguments/*"/>
1806 <xsl:with-param name="showstatic" select='0'/>
1807 </xsl:call-template>
1812 <xsl:template name="GetMemberNameWithoutGenericTypes">
1813 <xsl:param name="m" />
1815 <xsl:when test="contains ($m, '<')">
1816 <xsl:value-of select="substring-before ($m, '<')" />
1819 <xsl:value-of select="$m" />
1824 <xsl:template name="GetTypeParameterNames">
1825 <xsl:param name="member" />
1827 <xsl:for-each select="$member/TypeParameters/TypeParameter">
1828 <xsl:if test="not(position()=1)">, </xsl:if>
1829 <xsl:value-of select="@Name" />
1833 <xsl:template name="GetParameterTypes">
1834 <xsl:param name="member" />
1836 <xsl:for-each select="$member/Parameters/Parameter">
1837 <xsl:if test="not(position()=1)">, </xsl:if>
1838 <xsl:value-of select="@Type" />
1842 <xsl:template name="ListAllMembers">
1843 <xsl:param name="html-anchor" select="false()" />
1845 <xsl:call-template name="ListMembers">
1846 <xsl:with-param name="listmembertype" select="'Constructor'"/>
1847 <xsl:with-param name="showprotected" select="false()"/>
1848 <xsl:with-param name="html-anchor" select="$html-anchor" />
1849 </xsl:call-template>
1851 <xsl:call-template name="ListMembers">
1852 <xsl:with-param name="listmembertype" select="'Constructor'"/>
1853 <xsl:with-param name="showprotected" select="true()"/>
1854 <xsl:with-param name="html-anchor" select="$html-anchor" />
1855 </xsl:call-template>
1857 <xsl:call-template name="ListMembers">
1858 <xsl:with-param name="listmembertype" select="'Field'"/>
1859 <xsl:with-param name="showprotected" select="false()"/>
1860 <xsl:with-param name="html-anchor" select="$html-anchor" />
1861 </xsl:call-template>
1863 <xsl:call-template name="ListMembers">
1864 <xsl:with-param name="listmembertype" select="'Field'"/>
1865 <xsl:with-param name="showprotected" select="true()"/>
1866 <xsl:with-param name="html-anchor" select="$html-anchor" />
1867 </xsl:call-template>
1869 <xsl:call-template name="ListMembers">
1870 <xsl:with-param name="listmembertype" select="'Property'"/>
1871 <xsl:with-param name="showprotected" select="false()"/>
1872 <xsl:with-param name="html-anchor" select="$html-anchor" />
1873 </xsl:call-template>
1875 <xsl:call-template name="ListMembers">
1876 <xsl:with-param name="listmembertype" select="'Property'"/>
1877 <xsl:with-param name="showprotected" select="true()"/>
1878 <xsl:with-param name="html-anchor" select="$html-anchor" />
1879 </xsl:call-template>
1881 <xsl:call-template name="ListMembers">
1882 <xsl:with-param name="listmembertype" select="'Method'"/>
1883 <xsl:with-param name="showprotected" select="false()"/>
1884 <xsl:with-param name="html-anchor" select="$html-anchor" />
1885 </xsl:call-template>
1887 <xsl:call-template name="ListMembers">
1888 <xsl:with-param name="listmembertype" select="'Method'"/>
1889 <xsl:with-param name="showprotected" select="true()"/>
1890 <xsl:with-param name="html-anchor" select="$html-anchor" />
1891 </xsl:call-template>
1893 <xsl:call-template name="ListMembers">
1894 <xsl:with-param name="listmembertype" select="'Event'"/>
1895 <xsl:with-param name="showprotected" select="false()"/>
1896 <xsl:with-param name="html-anchor" select="$html-anchor" />
1897 </xsl:call-template>
1899 <xsl:call-template name="ListMembers">
1900 <xsl:with-param name="listmembertype" select="'Event'"/>
1901 <xsl:with-param name="showprotected" select="true()"/>
1902 <xsl:with-param name="html-anchor" select="$html-anchor" />
1903 </xsl:call-template>
1905 <xsl:call-template name="ListMembers">
1906 <xsl:with-param name="listmembertype" select="'Operator'"/>
1907 <xsl:with-param name="showprotected" select="false()"/>
1908 <xsl:with-param name="html-anchor" select="$html-anchor" />
1909 </xsl:call-template>
1911 <xsl:call-template name="ListMembers">
1912 <xsl:with-param name="listmembertype" select="'Explicit'"/>
1913 <xsl:with-param name="showprotected" select="true()"/>
1914 <xsl:with-param name="html-anchor" select="$html-anchor" />
1915 </xsl:call-template>
1917 <xsl:call-template name="ListMembers">
1918 <xsl:with-param name="listmembertype" select="'ExtensionMethod'"/>
1919 <xsl:with-param name="showprotected" select="false()"/>
1920 <xsl:with-param name="html-anchor" select="$html-anchor" />
1921 </xsl:call-template>
1924 <!-- Lists the members in the current Type node.
1925 Only lists members of type listmembertype.
1926 Displays the signature in siglanguage.
1927 showprotected = true() or false()
1929 <xsl:template name="ListMembers">
1930 <xsl:param name="listmembertype"/>
1931 <xsl:param name="showprotected"/>
1932 <xsl:param name="overloads-mode" select="false()" />
1933 <xsl:param name="html-anchor" select="false()" />
1935 <!-- get name and namespace of current type -->
1936 <xsl:variable name="TypeFullName" select="@FullName"/>
1937 <xsl:variable name="TypeName" select="@Name"/>
1938 <xsl:variable name="TypeNamespace" select="substring-before(@FullName, concat('.',@Name))"/>
1940 <xsl:variable name="MEMBERS-rtf">
1941 <xsl:call-template name="GetInheritedMembers">
1942 <xsl:with-param name="listmembertype" select="$listmembertype"/>
1943 <xsl:with-param name="showprotected" select="$showprotected"/>
1944 <xsl:with-param name="declaringtype" select="."/>
1945 <xsl:with-param name="overloads-mode" select="$overloads-mode" />
1946 </xsl:call-template>
1948 <xsl:variable name="MEMBERS" select="msxsl:node-set($MEMBERS-rtf)" />
1951 <xsl:variable name="MEMBERS" select="
1953 [(MemberType=$listmembertype or ($listmembertype='Operator' and MemberType='Method'))]
1954 [$showprotected=contains(MemberSignature[@Language='C#']/@Value,'protected')]
1955 [($listmembertype='Method' and not(starts-with(@MemberName,'op_')))
1956 or ($listmembertype='Operator' and starts-with(@MemberName,'op_'))
1957 or (not($listmembertype='Method') and not($listmembertype='Operator'))]
1961 <!-- if there aren't any, skip this -->
1962 <xsl:if test="count($MEMBERS//Member)">
1964 <xsl:variable name="SectionName">
1965 <xsl:if test="$listmembertype != 'Explicit' and $listmembertype != 'ExtensionMethod'">
1966 <xsl:if test="$showprotected">Protected </xsl:if>
1967 <xsl:if test="not($showprotected)">Public </xsl:if>
1969 <xsl:call-template name="membertypeplural"><xsl:with-param name="name" select="$listmembertype"/></xsl:call-template>
1973 <xsl:call-template name="CreateH2Section">
1974 <xsl:with-param name="name" select="$SectionName" />
1975 <xsl:with-param name="child-id" select="$SectionName" />
1976 <xsl:with-param name="content">
1977 <div class="SubsectionBox">
1978 <xsl:call-template name="CreateMembersTable">
1979 <xsl:with-param name="content">
1981 <xsl:for-each select="$MEMBERS/Members/Member">
1982 <!--<xsl:sort select="contains(MemberSignature[@Language='C#']/@Value,' static ')" data-type="text"/>-->
1983 <xsl:sort select="@MemberName = 'op_Implicit' or @MemberName = 'op_Explicit'"/>
1984 <xsl:sort select="@ExplicitMemberName" data-type="text"/>
1985 <xsl:sort select="count(TypeParameters/TypeParameter)"/>
1986 <xsl:sort select="@TypeParameters"/>
1987 <xsl:sort select="count(Parameters/Parameter)"/>
1988 <xsl:sort select="@Parameters"/>
1990 <xsl:variable name="local-id">
1992 <xsl:when test="count(Link) = 1">
1993 <xsl:value-of select="Link/@Member" />
1996 <xsl:call-template name="GetLinkId" >
1997 <xsl:with-param name="type" select="parent::Members" />
1998 <xsl:with-param name="member" select="." />
1999 </xsl:call-template>
2004 <xsl:variable name="linkfile">
2005 <xsl:if test="not(parent::Members/@FullName = $TypeFullName)">
2006 <xsl:call-template name="GetLinkTargetHtml">
2007 <xsl:with-param name="type">
2009 <xsl:when test="count(Link) = 1">
2010 <xsl:value-of select="Link/@Type"/>
2013 <xsl:call-template name="GetEscapedTypeName">
2014 <xsl:with-param name="typename" select="parent::Members/@FullName" />
2015 </xsl:call-template>
2019 <xsl:with-param name="cref" />
2020 </xsl:call-template>
2024 <xsl:variable name="linkid">
2025 <xsl:if test="$html-anchor">
2026 <xsl:value-of select="$linkfile" />
2027 <xsl:text>#</xsl:text>
2029 <xsl:value-of select="$local-id" />
2032 <xsl:variable name="isinherited">
2033 <xsl:if test="$listmembertype != 'ExtensionMethod' and not(parent::Members/@FullName = $TypeFullName)">
2034 <xsl:text> (</xsl:text>
2036 <xsl:text>Inherited from </xsl:text>
2037 <xsl:call-template name="maketypelink">
2038 <xsl:with-param name="type" select="parent::Members/@FullName"/>
2039 <xsl:with-param name="wrt" select="$TypeNamespace"/>
2040 </xsl:call-template>
2041 <xsl:text>.</xsl:text>
2043 <xsl:text>)</xsl:text>
2049 <!-- random info -->
2051 <!-- check if it has get and set accessors -->
2052 <xsl:if test="MemberType='Property' and not(contains(MemberSignature[@Language='C#']/@Value, 'set;'))">
2053 <xsl:text>[read-only]</xsl:text>
2055 <xsl:if test="MemberType='Property' and not(contains(MemberSignature[@Language='C#']/@Value, 'get;'))">
2056 <xsl:text>[write-only]</xsl:text>
2059 <xsl:if test="contains(MemberSignature[@Language='C#']/@Value,'this[')">
2060 <div><i>default property</i></div>
2064 <xsl:call-template name="getmodifiers">
2065 <xsl:with-param name="sig" select="MemberSignature[@Language='C#']/@Value"/>
2066 <xsl:with-param name="protection" select="false()"/>
2067 <xsl:with-param name="inheritance" select="true()"/>
2068 <xsl:with-param name="extra" select="false()"/>
2069 </xsl:call-template>
2074 <!-- constructor listing -->
2075 <xsl:when test="MemberType='Constructor'">
2076 <!-- link to constructor page -->
2080 <a href="{$linkid}">
2081 <xsl:call-template name="GetConstructorName">
2082 <xsl:with-param name="type" select="parent::Members" />
2083 <xsl:with-param name="ctor" select="." />
2084 </xsl:call-template>
2088 <!-- argument list -->
2089 <xsl:value-of select="'('"/>
2090 <xsl:for-each select="Parameters/Parameter">
2091 <xsl:if test="not(position()=1)">, </xsl:if>
2093 <xsl:call-template name="ShowParameter">
2094 <xsl:with-param name="Param" select="."/>
2095 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2096 <xsl:with-param name="prototype" select="true()"/>
2097 </xsl:call-template>
2099 <xsl:value-of select="')'"/>
2102 <!-- TODO: $implemented? -->
2107 <xsl:when test="$listmembertype = 'Explicit'">
2109 <a href="{$linkid}">
2111 <xsl:call-template name="GetMemberDisplayName">
2112 <xsl:with-param name="memberName" select="@MemberName" />
2113 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2114 </xsl:call-template>
2120 <!-- field, property and event listing -->
2121 <xsl:when test="MemberType='Field' or MemberType='Property' or MemberType='Event'">
2124 <!-- link to member page -->
2126 <a href="{$linkid}">
2127 <xsl:call-template name="GetMemberDisplayName">
2128 <xsl:with-param name="memberName" select="@MemberName" />
2129 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2130 </xsl:call-template>
2134 <!-- argument list for accessors -->
2135 <xsl:if test="Parameters/Parameter">
2136 <xsl:value-of select="'('"/>
2137 <xsl:for-each select="Parameters/Parameter">
2138 <xsl:if test="not(position()=1)">, </xsl:if>
2140 <xsl:call-template name="ShowParameter">
2141 <xsl:with-param name="Param" select="."/>
2142 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2143 <xsl:with-param name="prototype" select="true()"/>
2144 </xsl:call-template>
2147 <xsl:value-of select="')'"/>
2153 <!-- method listing -->
2154 <xsl:when test="$listmembertype='Method' or $listmembertype = 'ExtensionMethod'">
2157 <!-- link to method page -->
2159 <a href="{$linkid}">
2160 <xsl:call-template name="GetMemberDisplayName">
2161 <xsl:with-param name="memberName" select="@MemberName" />
2162 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2163 </xsl:call-template>
2167 <!-- argument list -->
2168 <xsl:value-of select="'('"/>
2169 <xsl:for-each select="Parameters/Parameter">
2170 <xsl:if test="not(position()=1)">, </xsl:if>
2172 <xsl:call-template name="ShowParameter">
2173 <xsl:with-param name="Param" select="."/>
2174 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2175 <xsl:with-param name="prototype" select="true()"/>
2176 </xsl:call-template>
2179 <xsl:value-of select="')'"/>
2181 <!-- return type -->
2182 <xsl:if test="not(ReturnValue/ReturnType='System.Void')">
2184 <xsl:text> : </xsl:text>
2185 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
2190 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
2191 <xsl:copy-of select="$isinherited"/>
2196 <xsl:when test="$listmembertype='Operator'">
2199 <!-- link to operator page -->
2201 <xsl:when test="@MemberName='op_Implicit' or @MemberName='op_Explicit'">
2203 <a href="{$linkid}">
2204 <xsl:text>Conversion</xsl:text>
2206 <xsl:when test="ReturnValue/ReturnType = //Type/@FullName">
2207 <xsl:text> From </xsl:text>
2208 <xsl:value-of select="Parameters/Parameter/@Type"/>
2211 <xsl:text> to </xsl:text>
2212 <xsl:value-of select="ReturnValue/ReturnType"/>
2219 <xsl:when test="@MemberName='op_Implicit'">
2220 <xsl:text>(Implicit)</xsl:text>
2223 <xsl:text>(Explicit)</xsl:text>
2227 <xsl:when test="count(Parameters/Parameter)=1">
2229 <a href="{$linkid}">
2230 <xsl:value-of select="substring-after(@MemberName, 'op_')"/>
2236 <a href="{$linkid}">
2237 <xsl:value-of select="substring-after(@MemberName, 'op_')"/>
2240 <xsl:value-of select="'('"/>
2241 <xsl:for-each select="Parameters/Parameter">
2242 <xsl:if test="not(position()=1)">, </xsl:if>
2244 <xsl:call-template name="ShowParameter">
2245 <xsl:with-param name="Param" select="."/>
2246 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2247 <xsl:with-param name="prototype" select="true()"/>
2248 </xsl:call-template>
2251 <xsl:value-of select="')'"/>
2258 <!-- Other types: just provide a link -->
2260 <a href="{$linkid}">
2261 <xsl:call-template name="GetMemberDisplayName">
2262 <xsl:with-param name="memberName" select="@MemberName" />
2263 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2264 </xsl:call-template>
2270 <xsl:if test="$listmembertype != 'Method' and $listmembertype != 'ExtensionMethod'">
2272 <!-- description -->
2273 <xsl:if test="MemberType='Field' or MemberType = 'Property'">
2274 <i><xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates></i>
2275 <xsl:if test="MemberValue"> (<xsl:value-of select="MemberValue"/>)</xsl:if>
2276 <xsl:text>. </xsl:text>
2279 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
2280 <xsl:copy-of select="$isinherited"/>
2288 </xsl:call-template>
2291 </xsl:call-template>
2297 <xsl:template name="GetLinkName">
2298 <xsl:param name="type"/>
2299 <xsl:param name="member"/>
2300 <xsl:call-template name="memberlinkprefix">
2301 <xsl:with-param name="member" select="$member"/>
2302 </xsl:call-template>
2303 <xsl:text>:</xsl:text>
2304 <xsl:call-template name="GetEscapedTypeName">
2305 <xsl:with-param name="typename" select="$type/@FullName" />
2306 </xsl:call-template>
2307 <xsl:if test="$member/MemberType != 'Constructor'">
2308 <xsl:text>.</xsl:text>
2309 <xsl:variable name="memberName">
2310 <xsl:call-template name="GetGenericName">
2311 <xsl:with-param name="membername" select="$member/@MemberName" />
2312 <xsl:with-param name="member" select="$member" />
2313 </xsl:call-template>
2315 <xsl:call-template name="Replace">
2316 <xsl:with-param name="s">
2317 <xsl:call-template name="ToBraces">
2318 <xsl:with-param name="s" select="$memberName" />
2319 </xsl:call-template>
2321 <xsl:with-param name="from">.</xsl:with-param>
2322 <xsl:with-param name="to">#</xsl:with-param>
2323 </xsl:call-template>
2327 <xsl:template name="GetGenericName">
2328 <xsl:param name="membername" />
2329 <xsl:param name="member" />
2330 <xsl:variable name="numgenargs" select="count($member/Docs/typeparam)" />
2332 <xsl:when test="$numgenargs = 0">
2333 <xsl:value-of select="$membername" />
2336 <xsl:if test="contains($membername, '<')">
2337 <xsl:value-of select="substring-before ($membername, '<')" />
2339 <xsl:text>``</xsl:text>
2340 <xsl:value-of select="$numgenargs" />
2345 <xsl:template name="GetEscapedTypeName">
2346 <xsl:param name="typename" />
2347 <xsl:variable name="base" select="substring-before ($typename, '<')" />
2350 <xsl:when test="$base != ''">
2351 <xsl:value-of select="translate ($base, '+', '.')" />
2352 <xsl:text>`</xsl:text>
2353 <xsl:call-template name="GetGenericArgumentCount">
2354 <xsl:with-param name="arglist" select="substring-after ($typename, '<')" />
2355 <xsl:with-param name="count">1</xsl:with-param>
2356 </xsl:call-template>
2358 <xsl:otherwise><xsl:value-of select="translate ($typename, '+', '.')" /></xsl:otherwise>
2362 <xsl:template name="GetGenericArgumentCount">
2363 <xsl:param name="arglist" />
2364 <xsl:param name="count" />
2366 <xsl:variable name="rest-rtf">
2367 <xsl:call-template name="SkipTypeArgument">
2368 <xsl:with-param name="s" select="$arglist" />
2369 </xsl:call-template>
2371 <xsl:variable name="rest" select="string($rest-rtf)" />
2374 <xsl:when test="$arglist != '' and $rest = ''">
2375 <xsl:value-of select="$count" />
2377 <xsl:when test="$arglist = '' and $rest = ''">
2378 <xsl:message terminate="yes">
2379 !WTF? arglist=<xsl:value-of select="$arglist" />; rest=<xsl:value-of select="$rest" />
2382 <xsl:when test="starts-with ($rest, '>')">
2383 <xsl:value-of select="$count" />
2384 <xsl:call-template name="GetEscapedTypeName">
2385 <xsl:with-param name="typename" select="substring-after ($rest, '>')" />
2386 </xsl:call-template>
2388 <xsl:when test="starts-with ($rest, ',')">
2389 <xsl:call-template name="GetGenericArgumentCount">
2390 <xsl:with-param name="arglist" select="substring-after ($rest, ',')" />
2391 <xsl:with-param name="count" select="$count+1" />
2392 </xsl:call-template>
2395 <xsl:message terminate="yes">
2396 !WTF 2? arglist=<xsl:value-of select="$arglist" />; rest=<xsl:value-of select="$rest" />
2402 <xsl:template name="SkipTypeArgument">
2403 <xsl:param name="s" />
2405 <xsl:variable name="p-rtf">
2406 <xsl:call-template name="GetCLtGtPositions">
2407 <xsl:with-param name="s" select="$s" />
2408 </xsl:call-template>
2410 <xsl:variable name="p" select="msxsl:node-set($p-rtf)"/>
2414 Have to select between three `s' patterns:
2415 A,B>: need to return ",B>"
2416 Foo<A,B>>: Need to forward to SkipGenericArgument to eventually return ">"
2417 Foo<A,B>+C>: Need to forward to SkipGenericArgument to eventually return ">"
2419 <xsl:when test="starts-with ($s, '>')">
2420 <xsl:message terminate="yes">
2421 SkipTypeArgument: invalid type substring '<xsl:value-of select="$s" />'
2424 <xsl:when test="$p/Comma/@Length > 0 and
2425 ($p/Lt/@Length = 0 or $p/Comma/@Length < $p/Lt/@Length) and
2426 ($p/Gt/@Length > 0 and $p/Comma/@Length < $p/Gt/@Length)">
2427 <xsl:text>,</xsl:text>
2428 <xsl:value-of select="substring-after ($s, ',')" />
2430 <xsl:when test="$p/Lt/@Length > 0 and $p/Lt/@Length < $p/Gt/@Length">
2431 <xsl:variable name="r">
2432 <xsl:call-template name="SkipGenericArgument">
2433 <xsl:with-param name="s" select="substring-after ($s, '<')" />
2434 </xsl:call-template>
2437 <xsl:when test="starts-with ($r, '>') or starts-with ($r, '+')">
2438 <xsl:value-of select="substring-after ($r, '>')" />
2440 <xsl:when test="starts-with ($r, ',')">
2441 <xsl:value-of select="$r" />
2445 ! WTF3: s=<xsl:value-of select="$s" />; r=<xsl:value-of select="$r" />
2450 <xsl:when test="$p/Gt/@Length > 0">
2451 <xsl:text>></xsl:text>
2452 <xsl:value-of select="substring-after ($s, '>')" />
2454 <xsl:otherwise><xsl:value-of select="$s" /></xsl:otherwise>
2458 <xsl:template name="GetCLtGtPositions">
2459 <xsl:param name="s" />
2461 <xsl:variable name="c" select="substring-before ($s, ',')" />
2462 <xsl:variable name="lt" select="substring-before ($s, '<')" />
2463 <xsl:variable name="gt" select="substring-before ($s, '>')" />
2465 <Comma String="{$c}" Length="{string-length ($c)}" />
2466 <Lt String="{$lt}" Length="{string-length ($lt)}" />
2467 <Gt String="{$gt}" Length="{string-length ($gt)}" />
2471 when given 'Foo<A,Bar<Baz<C,D,E>>>>', returns '>'
2472 when given 'Bar<C>+Nested>', returns '>'
2473 when given 'Foo<A,Bar<Baz<C,D,E>>>,', returns ','
2474 (basically, it matches '<' to '>' and "skips" the intermediate type-name contents.
2476 <xsl:template name="SkipGenericArgument">
2477 <xsl:param name="s" />
2479 <xsl:variable name="p-rtf">
2480 <xsl:call-template name="GetCLtGtPositions">
2481 <xsl:with-param name="s" select="$s" />
2482 </xsl:call-template>
2484 <xsl:variable name="p" select="msxsl:node-set($p-rtf)" />
2487 <xsl:when test="starts-with ($s, '>')">
2488 <xsl:message terminate="yes">
2489 SkipGenericArgument: invalid type substring '<xsl:value-of select="$s" />'
2492 <xsl:when test="$p/Lt/@Length > 0 and $p/Lt/@Length < $p/Gt/@Length">
2493 <!-- within 'Foo<A...'; look for matching '>' -->
2494 <xsl:variable name="r">
2495 <xsl:call-template name="SkipGenericArgument">
2496 <xsl:with-param name="s" select="substring-after ($s, '<')" />
2497 </xsl:call-template>
2499 <xsl:value-of select="substring-after ($r, '>')" />
2501 <xsl:when test="$p/Gt/@Length > 0">
2502 <!--<xsl:value-of select="substring ($s, string-length ($gt)+1)" />-->
2503 <xsl:value-of select="substring-after ($s, '>')" />
2506 <xsl:value-of select="$s" />
2511 <xsl:template name="GetEscapedParameter">
2512 <xsl:param name="orig-parameter-type" />
2513 <xsl:param name="parameter-type" />
2514 <xsl:param name="parameter-types" />
2515 <xsl:param name="escape" />
2516 <xsl:param name="index" />
2519 <xsl:when test="$index > count($parameter-types)">
2520 <xsl:if test="$parameter-type != $orig-parameter-type">
2521 <xsl:value-of select="$parameter-type" />
2525 <xsl:when test="$parameter-types[position() = $index]/@name = $parameter-type">
2526 <xsl:value-of select="concat ($escape, $index - 1)" />
2529 <xsl:variable name="typeparam" select="$parameter-types[position() = $index]/@name" />
2530 <xsl:call-template name="GetEscapedParameter">
2531 <xsl:with-param name="orig-parameter-type" select="$orig-parameter-type" />
2532 <xsl:with-param name="parameter-type">
2533 <xsl:call-template name="Replace">
2534 <xsl:with-param name="s">
2535 <xsl:call-template name="Replace">
2536 <xsl:with-param name="s">
2537 <xsl:call-template name="Replace">
2538 <xsl:with-param name="s">
2539 <xsl:call-template name="Replace">
2540 <xsl:with-param name="s" select="$parameter-type"/>
2541 <xsl:with-param name="from" select="concat('<', $typeparam, '>')" />
2542 <xsl:with-param name="to" select="concat('<', $escape, $index - 1, '>')" />
2543 </xsl:call-template>
2545 <xsl:with-param name="from" select="concat('<', $typeparam, ',')" />
2546 <xsl:with-param name="to" select="concat('<', $escape, $index - 1, ',')" />
2547 </xsl:call-template>
2549 <xsl:with-param name="from" select="concat (',', $typeparam, '>')" />
2550 <xsl:with-param name="to" select="concat(',', $escape, $index - 1, '>')" />
2551 </xsl:call-template>
2553 <xsl:with-param name="from" select="concat (',', $typeparam, ',')" />
2554 <xsl:with-param name="to" select="concat(',', $escape, $index - 1, ',')" />
2555 </xsl:call-template>
2557 <xsl:with-param name="parameter-types" select="$parameter-types" />
2558 <xsl:with-param name="typeparam" select="$typeparam" />
2559 <xsl:with-param name="escape" select="$escape" />
2560 <xsl:with-param name="index" select="$index + 1" />
2561 </xsl:call-template>
2566 <xsl:template name="GetLinkId">
2567 <xsl:param name="type"/>
2568 <xsl:param name="member"/>
2569 <xsl:call-template name="GetLinkName">
2570 <xsl:with-param name="type" select="$type" />
2571 <xsl:with-param name="member" select="$member" />
2572 </xsl:call-template>
2573 <xsl:if test="count($member/Parameters/Parameter) > 0 or $member/MemberType='Method' or $member/MemberType='Constructor'">
2574 <xsl:text>(</xsl:text>
2575 <xsl:for-each select="Parameters/Parameter">
2576 <xsl:if test="not(position()=1)">,</xsl:if>
2577 <xsl:call-template name="GetParameterType">
2578 <xsl:with-param name="type" select="$type" />
2579 <xsl:with-param name="member" select="$member" />
2580 <xsl:with-param name="parameter" select="." />
2581 </xsl:call-template>
2583 <xsl:text>)</xsl:text>
2585 <xsl:if test="$member/@MemberName='op_Implicit' or $member/@MemberName='op_Explicit'">
2586 <xsl:text>~</xsl:text>
2587 <xsl:variable name="parameter-rtf">
2588 <Parameter Type="{$member/ReturnValue/ReturnType}" />
2590 <xsl:call-template name="GetParameterType">
2591 <xsl:with-param name="type" select="$type" />
2592 <xsl:with-param name="member" select="$member" />
2593 <xsl:with-param name="parameter" select="msxsl:node-set($parameter-rtf)/Parameter" />
2594 </xsl:call-template>
2599 - what should be <xsl:value-of select="@Type" /> becomes a nightmare once
2600 - generics enter the picture, since a parameter type could come from the
2601 - type itelf (becoming `N) or from the method (becoming ``N).
2603 <xsl:template name="GetParameterType">
2604 <xsl:param name="type" />
2605 <xsl:param name="member" />
2606 <xsl:param name="parameter" />
2608 <!-- the actual parameter type -->
2609 <xsl:variable name="ptype">
2611 <xsl:when test="contains($parameter/@Type, '[')">
2612 <xsl:value-of select="substring-before ($parameter/@Type, '[')" />
2614 <xsl:when test="contains($parameter/@Type, '&')">
2615 <xsl:value-of select="substring-before ($parameter/@Type, '&')" />
2617 <xsl:when test="contains($parameter/@Type, '*')">
2618 <xsl:value-of select="substring-before ($parameter/@Type, '*')" />
2621 <xsl:value-of select="$parameter/@Type" />
2626 <!-- parameter modifiers -->
2627 <xsl:variable name="pmodifier">
2628 <xsl:call-template name="Replace">
2629 <xsl:with-param name="s" select="substring-after ($parameter/@Type, $ptype)" />
2630 <xsl:with-param name="from">&</xsl:with-param>
2631 <xsl:with-param name="to">@</xsl:with-param>
2632 </xsl:call-template>
2635 <xsl:variable name="gen-type">
2636 <xsl:call-template name="GetEscapedParameter">
2637 <xsl:with-param name="orig-parameter-type" select="$ptype" />
2638 <xsl:with-param name="parameter-type">
2639 <xsl:variable name="nested">
2640 <xsl:call-template name="GetEscapedParameter">
2641 <xsl:with-param name="orig-parameter-type" select="$ptype" />
2642 <xsl:with-param name="parameter-type" select="$ptype" />
2643 <xsl:with-param name="parameter-types" select="$type/Docs/typeparam" />
2644 <xsl:with-param name="escape" select="'`'" />
2645 <xsl:with-param name="index" select="1" />
2646 </xsl:call-template>
2649 <xsl:when test="$nested != ''">
2650 <xsl:value-of select="$nested" />
2653 <xsl:value-of select="$ptype" />
2657 <xsl:with-param name="parameter-types" select="$member/Docs/typeparam" />
2658 <xsl:with-param name="escape" select="'``'" />
2659 <xsl:with-param name="index" select="1" />
2660 </xsl:call-template>
2663 <!-- the actual parameter type -->
2664 <xsl:variable name="parameter-type">
2666 <xsl:when test="$gen-type != ''">
2667 <xsl:value-of select="$gen-type" />
2668 <xsl:value-of select="$pmodifier" />
2671 <xsl:value-of select="concat($ptype, $pmodifier)" />
2676 <!-- s/</{/g; s/>/}/g; so that less escaping is needed. -->
2677 <xsl:call-template name="Replace">
2678 <xsl:with-param name="s">
2679 <xsl:call-template name="Replace">
2680 <xsl:with-param name="s" select="translate ($parameter-type, '+', '.')" />
2681 <xsl:with-param name="from">></xsl:with-param>
2682 <xsl:with-param name="to">}</xsl:with-param>
2683 </xsl:call-template>
2685 <xsl:with-param name="from"><</xsl:with-param>
2686 <xsl:with-param name="to">{</xsl:with-param>
2687 </xsl:call-template>
2690 <xsl:template name="Replace">
2691 <xsl:param name="s" />
2692 <xsl:param name="from" />
2693 <xsl:param name="to" />
2695 <xsl:when test="not(contains($s, $from))">
2696 <xsl:value-of select="$s" />
2699 <xsl:variable name="prefix" select="substring-before($s, $from)"/>
2700 <xsl:variable name="suffix" select="substring-after($s, $from)" />
2701 <xsl:value-of select="$prefix" />
2702 <xsl:value-of select="$to" />
2703 <xsl:call-template name="Replace">
2704 <xsl:with-param name="s" select="$suffix" />
2705 <xsl:with-param name="from" select="$from" />
2706 <xsl:with-param name="to" select="$to" />
2707 </xsl:call-template>
2712 <xsl:template name="getmodifiers">
2713 <xsl:param name="sig"/>
2714 <xsl:param name="protection" select="true()"/>
2715 <xsl:param name="inheritance" select="true()"/>
2716 <xsl:param name="extra" select="true()"/>
2717 <xsl:param name="typetype" select="false()"/>
2719 <xsl:variable name="Sig">
2720 <xsl:text> </xsl:text>
2722 <xsl:when test="contains($sig, '{')">
2723 <xsl:value-of select="substring-before ($sig, '{')" />
2726 <xsl:value-of select="$sig" />
2729 <xsl:text> </xsl:text>
2732 <xsl:if test="$protection">
2733 <xsl:if test="contains($Sig, ' public ')">public </xsl:if>
2734 <xsl:if test="contains($Sig, ' private ')">private </xsl:if>
2735 <xsl:if test="contains($Sig, ' protected ')">protected </xsl:if>
2736 <xsl:if test="contains($Sig, ' internal ')">internal </xsl:if>
2739 <xsl:if test="contains($Sig, ' static ')">static </xsl:if>
2740 <xsl:if test="contains($Sig, ' abstract ')">abstract </xsl:if>
2741 <xsl:if test="contains($Sig, ' operator ')">operator </xsl:if>
2743 <xsl:if test="contains($Sig, ' const ')">const </xsl:if>
2744 <xsl:if test="contains($Sig, ' readonly ')">readonly </xsl:if>
2746 <xsl:if test="$inheritance">
2747 <xsl:if test="contains($Sig, ' override ')">override </xsl:if>
2748 <xsl:if test="contains($Sig, ' new ')">new </xsl:if>
2751 <xsl:if test="$extra">
2752 <xsl:if test="contains($Sig, ' sealed ')">sealed </xsl:if>
2753 <xsl:if test="contains($Sig, ' virtual ')">virtual </xsl:if>
2755 <xsl:if test="contains($Sig, ' extern ')">extern </xsl:if>
2756 <xsl:if test="contains($Sig, ' checked ')">checked </xsl:if>
2757 <xsl:if test="contains($Sig, ' unsafe ')">unsafe </xsl:if>
2758 <xsl:if test="contains($Sig, ' volatile ')">volatile </xsl:if>
2759 <xsl:if test="contains($Sig, ' explicit ')">explicit </xsl:if>
2760 <xsl:if test="contains($Sig, ' implicit ')">implicit </xsl:if>
2763 <xsl:if test="$typetype">
2764 <xsl:if test="contains($Sig, ' class ')">class </xsl:if>
2765 <xsl:if test="contains($Sig, ' interface ')">interface </xsl:if>
2766 <xsl:if test="contains($Sig, ' struct ')">struct </xsl:if>
2767 <xsl:if test="contains($Sig, ' delegate ')">delegate </xsl:if>
2768 <xsl:if test="contains($Sig, ' enum ')">enum </xsl:if>
2772 <xsl:template name="GetTypeDescription">
2773 <xsl:variable name="sig" select="TypeSignature[@Language='C#']/@Value"/>
2775 <xsl:when test="contains($sig, ' class ')">Class</xsl:when>
2776 <xsl:when test="contains($sig, ' interface ')">Interface</xsl:when>
2777 <xsl:when test="contains($sig, ' struct ')">Struct</xsl:when>
2778 <xsl:when test="contains($sig, ' delegate ')">Delegate</xsl:when>
2779 <xsl:when test="contains($sig, ' enum ')">Enum</xsl:when>
2783 <xsl:template match="since">
2785 <i>Note: This namespace, class, or member is supported only in version <xsl:value-of select="@version" />
2790 <xsl:template name="GetLinkTargetHtml">
2791 <xsl:param name="type" />
2792 <xsl:param name="cref" />
2794 <xsl:variable name="href">
2795 <xsl:call-template name="GetLinkTarget">
2796 <xsl:with-param name="type" select="$type" />
2797 <xsl:with-param name="cref" select="$cref" />
2798 </xsl:call-template>
2801 <xsl:when test="string($href) = ''">
2802 <xsl:text>javascript:alert("Documentation not found.")</xsl:text>
2804 <xsl:otherwise><xsl:value-of select="$href" /></xsl:otherwise>