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="'Articles'" />
844 <xsl:with-param name="type" select="'article'" />
846 <xsl:call-template name="CreateRelatedSection">
847 <xsl:with-param name="section" select="'Recipes'" />
848 <xsl:with-param name="type" select="'recipe'" />
850 <xsl:call-template name="CreateRelatedSection">
851 <xsl:with-param name="section" select="'Samples'" />
852 <xsl:with-param name="type" select="'sample'" />
854 <xsl:call-template name="CreateRelatedSection">
855 <xsl:with-param name="section" select="'Related specifications'" />
856 <xsl:with-param name="type" select="'specification'" />
858 <xsl:call-template name="CreateRelatedSection">
859 <xsl:with-param name="section" select="'External Documentation'" />
860 <xsl:with-param name="type" select="'externalDocumentation'" />
867 <xsl:call-template name="CreateH2Section">
868 <xsl:with-param name="name" select="'Requirements'"/>
869 <xsl:with-param name="child-id" select="concat ($linkid, ':Version Information')" />
870 <xsl:with-param name="content">
871 <xsl:call-template name="CreatePlatformRequirements" />
872 <b>Namespace: </b><xsl:value-of select="substring(/Type/@FullName, 1, string-length(/Type/@FullName) - string-length(/Type/@Name) - 1)" />
873 <xsl:if test="count(/Type/AssemblyInfo/AssemblyName) > 0">
876 <xsl:value-of select="/Type/AssemblyInfo/AssemblyName" />
877 <xsl:text> (in </xsl:text>
878 <xsl:value-of select="/Type/AssemblyInfo/AssemblyName" />
879 <xsl:text>.dll)</xsl:text>
881 <xsl:if test="count(AssemblyInfo/AssemblyVersion) > 0">
883 <b>Assembly Versions: </b>
884 <xsl:for-each select="AssemblyInfo/AssemblyVersion">
885 <xsl:if test="not(position()=1)">, </xsl:if>
886 <xsl:value-of select="."/>
889 <xsl:if test="count(Docs/since) > 0">
892 <xsl:for-each select="Docs/since">
893 <xsl:if test="not(position()=1)">; </xsl:if>
894 <xsl:value-of select="@version"/>
897 <xsl:if test="count(Docs/since)=0 and count(/Type/Docs/since) > 0">
900 <xsl:for-each select="/Type/Docs/since">
901 <xsl:if test="not(position()=1)">; </xsl:if>
902 <xsl:value-of select="@version"/>
910 <!-- 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. -->
912 <xsl:template match="*|@*" mode="typelink">
913 <xsl:param name="wrt" select="'notset'"/>
915 <xsl:call-template name="maketypelink">
916 <xsl:with-param name="type" select="."/>
917 <xsl:with-param name="wrt" select="$wrt"/>
921 <xsl:template name="makenamespacelink">
922 <xsl:param name="cref" select="''"/>
925 <xsl:attribute name="href">
926 <xsl:call-template name="GetLinkTargetHtml">
927 <xsl:with-param name="cref" select="$cref" />
931 <xsl:value-of select="substring-after ($cref, 'N:')" />
935 <xsl:template name="maketypelink">
936 <xsl:param name="type" select="'notset'"/>
937 <xsl:param name="wrt" select="'notset'"/>
938 <xsl:param name="nested" select="0"/>
940 <xsl:variable name="btype">
941 <xsl:call-template name="ToBrackets">
942 <xsl:with-param name="s" select="$type" />
946 <xsl:variable name="array">
947 <xsl:call-template name="GetArraySuffix">
948 <xsl:with-param name="type" select="$type" />
955 <xsl:when test="starts-with($type, 'T:')">
956 <xsl:call-template name="maketypelink">
957 <xsl:with-param name="type" select="substring($type, 3)"/>
958 <xsl:with-param name="wrt" select="$wrt"/>
962 <xsl:when test="contains ($type, '&') and
963 '&' = substring ($type, string-length ($type), 1)">
964 <xsl:call-template name="maketypelink">
965 <xsl:with-param name="type" select="substring($type, 1, string-length($type)-1)"/>
966 <xsl:with-param name="wrt" select="$wrt"/>
970 <xsl:when test="string($array)">
971 <xsl:call-template name="maketypelink">
972 <xsl:with-param name="type" select="substring($type, 1, string-length($type) - string-length ($array))"/>
973 <xsl:with-param name="wrt" select="$wrt"/>
975 <xsl:value-of select="$array"/>
978 <xsl:when test="contains ($type, '*') and
979 '*' = substring ($type, string-length ($type), 1)">
980 <xsl:call-template name="maketypelink">
981 <xsl:with-param name="type" select="substring($type, 1, string-length($type)-1)"/>
982 <xsl:with-param name="wrt" select="$wrt"/>
984 <xsl:value-of select="'*'"/>
987 <!-- if this is a generic type parameter, don't make a link but italicize it and give it a tooltip instead -->
988 <xsl:when test="count($ThisType/TypeParameters/TypeParameter[@Name=$type] |
989 $ThisType/TypeParameters/TypeParameter[child::text()=$type] |
990 ancestor::Member/Docs/typeparam[@name=$type]) = 1">
991 <!-- 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 -->
992 <i title="{$ThisType/Docs/typeparam[@name=$type] | ancestor::Member/Docs/typeparam[@name=$type]}"><xsl:value-of select="$type"/></i>
995 <!-- if this is a generic type parameter of a base type, replace it with the type that it was instantiated with -->
996 <xsl:when test="count(ancestor::Members/BaseTypeArgument[@TypeParamName=$type]) = 1">
997 <!-- 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 -->
998 <xsl:call-template name="maketypelink">
999 <xsl:with-param name="type" select="ancestor::Members/BaseTypeArgument[@TypeParamName=$type]"/>
1000 <xsl:with-param name="wrt" select="$wrt"/>
1001 </xsl:call-template>
1006 <xsl:variable name="escaped-type">
1007 <xsl:call-template name="GetEscapedTypeName">
1008 <xsl:with-param name="typename" select="$btype" />
1009 </xsl:call-template>
1012 <xsl:attribute name="href">
1013 <xsl:call-template name="GetLinkTargetHtml">
1014 <xsl:with-param name="type" select="$escaped-type" />
1015 <xsl:with-param name="cref" select="concat ('T:', $escaped-type)" />
1016 </xsl:call-template>
1019 <xsl:call-template name="GetTypeDisplayName">
1020 <xsl:with-param name="T" select="$btype"/>
1021 <xsl:with-param name="wrt" select="$wrt"/>
1022 </xsl:call-template>
1028 <xsl:template name="GetArraySuffix">
1029 <xsl:param name="type" />
1031 <xsl:if test="contains ($type, ']') and
1032 ']' = substring ($type, string-length ($type), 1)">
1033 <xsl:variable name="start">
1034 <xsl:call-template name="GetArraySuffixStart">
1035 <xsl:with-param name="type" select="$type" />
1036 <xsl:with-param name="i" select="string-length ($type) - 1" />
1037 </xsl:call-template>
1039 <xsl:value-of select="substring ($type, $start)" />
1043 <xsl:template name="GetArraySuffixStart">
1044 <xsl:param name="type" />
1045 <xsl:param name="i" />
1048 <xsl:when test="substring ($type, $i, 1) = '['">
1049 <xsl:value-of select="$i" />
1052 <xsl:call-template name="GetArraySuffixStart">
1053 <xsl:with-param name="type" select="$type" />
1054 <xsl:with-param name="i" select="$i - 1" />
1055 </xsl:call-template>
1060 <xsl:template name="GetTypeDisplayName">
1061 <xsl:param name="T"/>
1062 <xsl:param name="wrt"/>
1064 <!-- use C#-style names -->
1066 <xsl:when test="$T='System.Object'">object</xsl:when>
1067 <xsl:when test="$T='System.Boolean'">bool</xsl:when>
1068 <xsl:when test="$T='System.Byte'">byte</xsl:when>
1069 <xsl:when test="$T='System.Char'">char</xsl:when>
1070 <xsl:when test="$T='System.Decimal'">decimal</xsl:when>
1071 <xsl:when test="$T='System.Double'">double</xsl:when>
1072 <xsl:when test="$T='System.Int16'">short</xsl:when>
1073 <xsl:when test="$T='System.Int32'">int</xsl:when>
1074 <xsl:when test="$T='System.Int64'">long</xsl:when>
1075 <xsl:when test="$T='System.SByte'">sbyte</xsl:when>
1076 <xsl:when test="$T='System.Single'">float</xsl:when>
1077 <xsl:when test="$T='System.String'">string</xsl:when>
1078 <xsl:when test="$T='System.UInt16'">ushort</xsl:when>
1079 <xsl:when test="$T='System.UInt32'">uint</xsl:when>
1080 <xsl:when test="$T='System.UInt64'">ulong</xsl:when>
1081 <xsl:when test="$T='System.Void'">void</xsl:when>
1083 <xsl:when test="contains($T, '<')">
1084 <xsl:call-template name="GetTypeDisplayName">
1085 <xsl:with-param name="T" select="substring-before ($T, '<')" />
1086 <xsl:with-param name="wrt" select="$wrt" />
1087 </xsl:call-template>
1088 <xsl:text><</xsl:text>
1089 <xsl:call-template name="GetMemberArgList">
1090 <xsl:with-param name="arglist" select="substring-after ($T, '<')" />
1091 <xsl:with-param name="wrt" select="$wrt" />
1092 </xsl:call-template>
1093 <!-- don't need to append > as GetMemberArgList (eventually) appends it -->
1096 <!-- if the type is in the wrt namespace, omit the namespace name -->
1097 <xsl:when test="not($wrt='') and starts-with($T, concat($wrt,'.')) and not(contains(substring-after($T,concat($wrt,'.')), '.'))">
1098 <xsl:value-of select="translate (substring-after($T,concat($wrt,'.')), '+', '.')"/>
1101 <!-- if the type is in the System namespace, omit the namespace name -->
1102 <xsl:when test="starts-with($T, 'System.') and not(contains(substring-after($T, 'System.'), '.'))">
1103 <xsl:value-of select="translate (substring-after($T,'System.'), '+', '.')"/>
1106 <!-- if the type is in the System.Collections namespace, omit the namespace name -->
1107 <xsl:when test="starts-with($T, 'System.Collections.') and not(contains(substring-after($T, 'System.Collections.'), '.'))">
1108 <xsl:value-of select="translate (substring-after($T,'System.Collections.'), '+', '.')"/>
1111 <!-- if the type is in the System.Collections.Generic namespace, omit the namespace name -->
1112 <xsl:when test="starts-with($T, 'System.Collections.Generic.') and not(contains(substring-after($T, 'System.Collections.Generic.'), '.'))">
1113 <xsl:value-of select="translate (substring-after($T,'System.Collections.Generic.'), '+', '.')"/>
1117 <xsl:value-of select="translate ($T, '+', '.')" />
1122 <xsl:template name="GetMemberDisplayName">
1123 <xsl:param name="memberName" />
1124 <xsl:param name="isproperty" select="false()" />
1127 <xsl:when test="contains($memberName, '.')">
1128 <xsl:call-template name="GetTypeDisplayName">
1129 <xsl:with-param name="T">
1130 <xsl:call-template name="GetTypeName">
1131 <xsl:with-param name="type" select="$memberName"/>
1132 </xsl:call-template>
1134 <xsl:with-param name="wrt" select="''" />
1135 </xsl:call-template>
1136 <xsl:text>.</xsl:text>
1137 <xsl:call-template name="GetMemberName">
1138 <xsl:with-param name="type" select="$memberName" />
1139 <xsl:with-param name="isproperty" select="$isproperty"/>
1140 </xsl:call-template>
1143 <xsl:value-of select="$memberName" />
1148 <xsl:template name="ToBrackets">
1149 <xsl:param name="s" />
1150 <xsl:value-of select="translate (translate ($s, '{', '<'), '}', '>')" />
1153 <xsl:template name="ToBraces">
1154 <xsl:param name="s" />
1155 <xsl:value-of select="translate (translate ($s, '<', '{'), '>', '}')" />
1158 <xsl:template name="memberlinkprefix">
1159 <xsl:param name="member" />
1161 <xsl:when test="$member/MemberType='Constructor'">C</xsl:when>
1162 <xsl:when test="$member/MemberType='Method'">M</xsl:when>
1163 <xsl:when test="$member/MemberType='Property'">P</xsl:when>
1164 <xsl:when test="$member/MemberType='Field'">F</xsl:when>
1165 <xsl:when test="$member/MemberType='Event'">E</xsl:when>
1169 <xsl:template name="makememberlink">
1170 <xsl:param name="cref"/>
1172 <xsl:variable name="bcref">
1173 <xsl:call-template name="ToBrackets">
1174 <xsl:with-param name="s" select="$cref" />
1175 </xsl:call-template>
1178 <xsl:variable name="fullname">
1180 <xsl:when test="starts-with($bcref, 'C:') or starts-with($bcref, 'T:')">
1182 <xsl:when test="contains($bcref, '(')">
1183 <xsl:value-of select="substring (substring-before ($bcref, '('), 3)" />
1186 <xsl:value-of select="substring($bcref, 3)" />
1191 <xsl:call-template name="GetTypeName">
1192 <xsl:with-param name="type" select="substring($bcref, 3)"/>
1193 </xsl:call-template>
1198 <xsl:variable name="memberName">
1200 <xsl:when test="starts-with($bcref, 'T:')" />
1201 <xsl:when test="starts-with($bcref, 'C:') and not(contains($bcref, '('))" />
1202 <xsl:when test="starts-with($bcref, 'C:') and contains($bcref, '(')">
1203 <xsl:text>(</xsl:text>
1204 <xsl:call-template name="GetMemberArgList">
1205 <xsl:with-param name="arglist" select="substring-before(substring-after($bcref, '('), ')')" />
1206 <xsl:with-param name="wrt" select="$TypeNamespace" />
1207 </xsl:call-template>
1208 <xsl:text>)</xsl:text>
1211 <xsl:text>.</xsl:text>
1212 <xsl:call-template name="GetMemberName">
1213 <xsl:with-param name="type" select="substring($bcref, 3)" />
1214 <xsl:with-param name="wrt" select="$fullname"/>
1215 <xsl:with-param name="isproperty" select="starts-with($bcref, 'P:')"/>
1216 </xsl:call-template>
1221 <xsl:variable name="escaped-type">
1222 <xsl:call-template name="GetEscapedTypeName">
1223 <xsl:with-param name="typename">
1224 <xsl:call-template name="ToBrackets">
1225 <xsl:with-param name="s" select="$fullname" />
1226 </xsl:call-template>
1228 </xsl:call-template>
1230 <xsl:variable name="displayname">
1231 <xsl:call-template name="GetTypeDisplayName">
1232 <xsl:with-param name="T" select="$fullname" />
1233 <xsl:with-param name="wrt" select="$TypeNamespace"/>
1234 </xsl:call-template>
1237 <xsl:attribute name="href">
1238 <xsl:call-template name="GetLinkTargetHtml">
1239 <xsl:with-param name="type" select="$escaped-type" />
1240 <xsl:with-param name="cref">
1241 <xsl:call-template name="ToBraces">
1242 <xsl:with-param name="s" select="$cref" />
1243 </xsl:call-template>
1245 </xsl:call-template>
1247 <xsl:value-of select="translate (concat($displayname, $memberName), '+', '.')" />
1251 <xsl:template name="GetTypeName">
1252 <xsl:param name="type" />
1253 <xsl:variable name="prefix" select="substring-before($type, '.')" />
1254 <xsl:variable name="suffix" select="substring-after($type, '.')" />
1256 <xsl:when test="contains($type, '(')">
1257 <xsl:call-template name="GetTypeName">
1258 <xsl:with-param name="type" select="substring-before($type, '(')" />
1259 </xsl:call-template>
1261 <xsl:when test="not(contains($suffix, '.'))">
1262 <xsl:value-of select="$prefix" />
1265 <xsl:value-of select="$prefix" />
1266 <xsl:text>.</xsl:text>
1267 <xsl:call-template name="GetTypeName">
1268 <xsl:with-param name="type" select="$suffix" />
1269 </xsl:call-template>
1274 <xsl:template name="GetMemberName">
1275 <xsl:param name="type" />
1276 <xsl:param name="isproperty" select="0"/>
1277 <xsl:variable name="prefix" select="substring-before($type, '.')" />
1278 <xsl:variable name="suffix" select="substring-after($type, '.')" />
1280 <xsl:when test="contains($type, '(')">
1281 <xsl:call-template name="GetMemberName">
1282 <xsl:with-param name="type" select="substring-before($type, '(')" />
1283 </xsl:call-template>
1284 <xsl:text>(</xsl:text>
1285 <xsl:call-template name="GetMemberArgList">
1286 <xsl:with-param name="arglist" select="substring-before(substring-after($type, '('), ')')" />
1287 <xsl:with-param name="wrt" select="$TypeNamespace" />
1288 </xsl:call-template>
1289 <xsl:text>)</xsl:text>
1291 <xsl:when test="not(contains($suffix, '.'))">
1292 <xsl:value-of select="$suffix" />
1295 <xsl:call-template name="GetMemberName">
1296 <xsl:with-param name="type" select="$suffix" />
1297 </xsl:call-template>
1302 <xsl:template name="GetMemberArgList">
1303 <xsl:param name="arglist" />
1304 <xsl:param name="wrt" select="''"/>
1306 <xsl:variable name="_arglist">
1308 <xsl:when test="starts-with ($arglist, ',')">
1309 <xsl:value-of select="substring-after ($arglist, ',')" />
1312 <xsl:value-of select="$arglist" />
1317 <xsl:if test="starts-with ($arglist, ',')">
1318 <xsl:text>, </xsl:text>
1321 <xsl:variable name="c" select="substring-before ($_arglist, ',')" />
1322 <xsl:variable name="lt" select="substring-before ($_arglist, '<')" />
1323 <xsl:variable name="gt" select="substring-before ($_arglist, '>')" />
1326 <!-- Need to insert ',' between type arguments -->
1328 ($c != '' and $lt != '' and $gt != '' and
1329 string-length ($c) < string-length ($lt) and
1330 string-length ($c) < string-length ($gt)) or
1331 ($c != '' and $lt != '' and $gt = '' and
1332 string-length ($c) < string-length ($lt)) or
1333 ($c != '' and $lt = '' and $gt != '' and
1334 string-length ($c) < string-length ($gt)) or
1335 ($c != '' and $lt = '' and $gt = '')">
1336 <xsl:call-template name="GetTypeDisplayName">
1337 <xsl:with-param name="T" select="$c"/>
1338 <xsl:with-param name="wrt" select="$wrt"/>
1339 </xsl:call-template>
1340 <xsl:text>, </xsl:text>
1341 <xsl:call-template name="GetMemberArgList">
1342 <xsl:with-param name="arglist" select="substring-after($_arglist, ',')" />
1343 <xsl:with-param name="wrt" select="$wrt" />
1344 </xsl:call-template>
1347 <!-- start of nested type argument list < -->
1349 ($c != '' and $lt != '' and $gt != '' and
1350 string-length ($lt) < string-length ($c) and
1351 string-length ($lt) < string-length ($gt)) or
1352 ($c != '' and $lt != '' and $gt = '' and
1353 string-length ($lt) < string-length ($c)) or
1354 ($c = '' and $lt != '' and $gt != '' and
1355 string-length ($lt) < string-length ($gt))">
1356 <xsl:call-template name="GetTypeDisplayName">
1357 <xsl:with-param name="T" select="$lt"/>
1358 <xsl:with-param name="wrt" select="$wrt"/>
1359 </xsl:call-template>
1360 <xsl:text><</xsl:text>
1361 <xsl:call-template name="GetMemberArgList">
1362 <xsl:with-param name="arglist" select="substring-after($_arglist, '<')" />
1363 <xsl:with-param name="wrt" select="$wrt" />
1364 </xsl:call-template>
1367 <!-- end of (nested?) type argument list > -->
1369 ($c != '' and $lt != '' and $gt != '' and
1370 string-length ($gt) < string-length ($c) and
1371 string-length ($gt) < string-length ($lt)) or
1372 ($c != '' and $lt = '' and $gt = '' and
1373 string-length ($gt) < string-length ($c)) or
1374 ($c = '' and $lt != '' and $gt != '' and
1375 string-length ($gt) < string-length ($lt)) or
1376 ($c = '' and $lt = '' and $gt != '')">
1377 <xsl:call-template name="GetTypeDisplayName">
1378 <xsl:with-param name="T" select="$gt"/>
1379 <xsl:with-param name="wrt" select="$wrt"/>
1380 </xsl:call-template>
1381 <xsl:text>></xsl:text>
1382 <xsl:call-template name="GetMemberArgList">
1383 <xsl:with-param name="arglist" select="substring-after($_arglist, '>')" />
1384 <xsl:with-param name="wrt" select="$wrt" />
1385 </xsl:call-template>
1388 <!-- nothing left to do -->
1390 <xsl:call-template name="GetTypeDisplayName">
1391 <xsl:with-param name="T" select="$_arglist"/>
1392 <xsl:with-param name="wrt" select="$wrt"/>
1393 </xsl:call-template>
1398 <!-- Transforms the contents of the selected node containing a cref into a hyperlink. -->
1399 <xsl:template match="*|@*" mode="cref">
1400 <xsl:call-template name="makememberlink">
1401 <xsl:with-param name="cref" select="."/>
1402 </xsl:call-template>
1405 <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
1406 <xsl:value-of select="substring-after(., ':')"/></a>
1410 <xsl:template name="membertypeplural">
1411 <xsl:param name="name"/>
1413 <xsl:when test="$name='ExtensionMethod'">Extension Methods</xsl:when>
1414 <xsl:when test="$name='Constructor'">Constructors</xsl:when>
1415 <xsl:when test="$name='Property'">Properties</xsl:when>
1416 <xsl:when test="$name='Method'">Methods</xsl:when>
1417 <xsl:when test="$name='Field'">Fields</xsl:when>
1418 <xsl:when test="$name='Event'">Events</xsl:when>
1419 <xsl:when test="$name='Operator'">Operators</xsl:when>
1420 <xsl:when test="$name='Explicit'">Explicitly Implemented Interface Members</xsl:when>
1423 <xsl:template name="membertypeplurallc">
1424 <xsl:param name="name"/>
1426 <xsl:when test="$name='ExtensionMethod'">extension methods</xsl:when>
1427 <xsl:when test="$name='Constructor'">constructors</xsl:when>
1428 <xsl:when test="$name='Property'">properties</xsl:when>
1429 <xsl:when test="$name='Method'">methods</xsl:when>
1430 <xsl:when test="$name='Field'">fields</xsl:when>
1431 <xsl:when test="$name='Event'">events</xsl:when>
1432 <xsl:when test="$name='Operator'">operators</xsl:when>
1433 <xsl:when test="$name='Explicit'">explicitly implemented interface members</xsl:when>
1436 <xsl:template name="gettypetype">
1437 <xsl:variable name="sig" select="concat(' ', TypeSignature[@Language='C#']/@Value, ' ')"/>
1439 <xsl:when test="contains($sig,'class')">Class</xsl:when>
1440 <xsl:when test="contains($sig,'enum')">Enumeration</xsl:when>
1441 <xsl:when test="contains($sig,'struct')">Structure</xsl:when>
1442 <xsl:when test="contains($sig,'delegate')">Delegate</xsl:when>
1446 <!-- Ensures that the resuting node is not surrounded by a para tag. -->
1447 <xsl:template match="*|@*" mode="editlink">
1448 <xsl:call-template name="CreateEditLink">
1449 <xsl:with-param name="e" select="." />
1450 </xsl:call-template>
1453 <xsl:template match="*" mode="notoppara">
1455 <xsl:when test="starts-with (string(.), 'To be added')">
1456 <span class="NotEntered">Documentation for this section has not yet been entered.</span>
1458 <xsl:when test="count(*) = 1 and count(para)=1">
1459 <xsl:apply-templates select="para/node()"/>
1462 <xsl:apply-templates select="."/>
1467 <xsl:template match="para">
1469 <xsl:apply-templates/>
1473 <xsl:template match="attribution">
1474 <a href="http://creativecommons.org/licenses/by/4.0/" class="attributionlogo">
1475 <xsl:attribute name="title">
1477 <xsl:when test="@modified='false'"><xsl:value-of select="concat('This content is licensed Creative Commons By ', @from)" /></xsl:when>
1478 <xsl:otherwise><xsl:value-of select="concat('This content has been modified under a Creative Commons license from ', @from)" /></xsl:otherwise>
1481 <img src="mdocimages/creativecommons.png" />
1485 <xsl:template match="paramref">
1486 <i><xsl:value-of select="@name"/>
1487 <xsl:apply-templates/>
1491 <xsl:template match="typeparamref">
1492 <i><xsl:value-of select="@name"/>
1493 <xsl:apply-templates/>
1497 <xsl:template match="block[@type='note']">
1500 <xsl:apply-templates/>
1503 <xsl:template match="block[@type='behaviors']">
1504 <h5 class="Subsection">Operation</h5>
1505 <xsl:apply-templates/>
1507 <xsl:template match="block[@type='overrides']">
1508 <h5 class="Subsection">Note to Inheritors</h5>
1509 <xsl:apply-templates/>
1511 <xsl:template match="block[@type='usage']">
1512 <h5 class="Subsection">Usage</h5>
1513 <xsl:apply-templates/>
1516 <xsl:template match="c">
1518 <xsl:apply-templates/>
1521 <xsl:template match="c//para">
1522 <xsl:apply-templates/><br/>
1525 <xsl:template match="code">
1526 <xsl:call-template name="CreateCodeBlock">
1527 <xsl:with-param name="language" select="@lang" />
1528 <xsl:with-param name="content" select="string(descendant-or-self::text())" />
1529 </xsl:call-template>
1531 <xsl:template match="img">
1534 <xsl:attribute name="src">
1535 <!-- we recognize two types of images:
1536 - those with src attribute that reference directly an external image
1537 - those with a href attributes which are internally available as part of the doc bundle
1540 <xsl:when test="count(@src)>0">
1541 <xsl:value-of select="@src" />
1543 <xsl:when test="count(@href)>0">
1544 <xsl:value-of select="concat('source-id:', $source-id, ':', @href)" />
1548 <xsl:attribute name="class">
1550 <xsl:when test="count(@class)>0">
1551 <xsl:value-of select="@class" />
1553 <xsl:otherwise>picture</xsl:otherwise>
1560 <xsl:template match="onequarter">¼</xsl:template>
1561 <xsl:template match="pi">Ï€</xsl:template>
1562 <xsl:template match="theta">θ</xsl:template>
1563 <xsl:template match="leq">≤</xsl:template>
1564 <xsl:template match="geq">≥</xsl:template>
1565 <xsl:template match="subscript">
1566 <sub><xsl:value-of select="@term"/></sub>
1568 <xsl:template match="superscript">
1569 <sup><xsl:value-of select="@term"/></sup>
1577 <term>First Col Header</term>
1578 <description>Second Col Header</description>
1579 <description>Third Col Header</description>
1582 <term>First Row First Col</term>
1583 <description>First Row Second Col</description>
1584 <description>First Row Third Col</description>
1587 <term>Second Row First Col</term>
1588 <description>Second Row Second Col</description>
1589 <description>Second Row Third Col</description>
1594 <xsl:template match="list[@type='table']">
1595 <xsl:call-template name="CreateListTable">
1596 <xsl:with-param name="header">
1597 <th><xsl:apply-templates select="listheader/term" mode="notoppara"/></th>
1598 <xsl:for-each select="listheader/description">
1599 <th><xsl:apply-templates mode="notoppara"/></th>
1603 <xsl:with-param name="content">
1604 <xsl:for-each select="item">
1607 <xsl:apply-templates select="term" mode="notoppara"/>
1609 <xsl:for-each select="description">
1611 <xsl:apply-templates mode="notoppara"/>
1617 </xsl:call-template>
1620 <xsl:template match="list[@type='bullet']">
1622 <xsl:for-each select="item">
1624 <xsl:apply-templates select="term" mode="notoppara"/>
1625 <xsl:apply-templates select="para" mode="notoppara"/>
1630 <xsl:template match="list[@type='number']">
1632 <xsl:for-each select="item">
1634 <xsl:apply-templates select="term" mode="notoppara"/>
1640 <xsl:template match="list">
1641 [<i>The '<xsl:value-of select="@type"/>' type of list has not been implemented in the ECMA stylesheet.</i>]
1644 [<i>The '<xsl:value-of select="@type"/>' type of list has not been implemented in the ECMA stylesheet.</i>]
1648 <xsl:template match="see[@cref]">
1650 <xsl:when test="not(substring-after(@cref, 'T:')='')">
1651 <xsl:call-template name="maketypelink">
1652 <xsl:with-param name="type" select="normalize-space (@cref)"/>
1653 </xsl:call-template>
1655 <xsl:when test="not(substring-after(@cref, 'N:')='')">
1656 <xsl:call-template name="makenamespacelink">
1657 <xsl:with-param name="cref" select="normalize-space (@cref)"/>
1658 </xsl:call-template>
1661 <xsl:call-template name="makememberlink">
1662 <xsl:with-param name="cref" select="normalize-space (@cref)"/>
1663 </xsl:call-template>
1668 <xsl:template match="see[@langword]">
1669 <tt><xsl:value-of select="@langword"/></tt>
1672 <xsl:template name="GetInheritedMembers">
1673 <xsl:param name="declaringtype"/>
1674 <xsl:param name="generictypereplacements"/>
1675 <xsl:param name="listmembertype"/>
1676 <xsl:param name="showprotected"/>
1677 <xsl:param name="overloads-mode" select="false()" />
1678 <xsl:param name="showstatic" select='1'/>
1681 <xsl:when test="$listmembertype='ExtensionMethod' and $showprotected=false()">
1682 <xsl:for-each select="$declaringtype/Members/Member[MemberType=$listmembertype]">
1683 <Members Name="Link/@Type" FullName="Link/@Type">
1684 <Member MemberName="{@MemberName}">
1685 <xsl:attribute name="ExplicitMemberName">
1686 <xsl:call-template name="GetMemberNameWithoutGenericTypes">
1687 <xsl:with-param name="m" select="@MemberName" />
1688 </xsl:call-template>
1690 <xsl:attribute name="TypeParameters">
1691 <xsl:call-template name="GetTypeParameterNames">
1692 <xsl:with-param name="member" select="." />
1693 </xsl:call-template>
1695 <xsl:attribute name="Parameters">
1696 <xsl:call-template name="GetParameterTypes">
1697 <xsl:with-param name="member" select="." />
1698 </xsl:call-template>
1700 <xsl:copy-of select="./*" />
1706 <Members Name="{$declaringtype/@Name}" FullName="{$declaringtype/@FullName}">
1708 <xsl:copy-of select="$generictypereplacements"/>
1710 <!-- Get all members in this type that are of listmembertype and are either
1711 protected or not protected according to showprotected. -->
1713 <xsl:when test="$listmembertype = 'Explicit'">
1714 <xsl:for-each select="$declaringtype/Members/Member
1715 [MemberType != 'Constructor']
1716 [contains (@MemberName, '.')]">
1717 <Member MemberName="{@MemberName}">
1718 <xsl:attribute name="ExplicitMemberName">
1719 <xsl:call-template name="GetMemberName">
1720 <xsl:with-param name="type" select="@MemberName" />
1721 <xsl:with-param name="isproperty" select="$listmembertype = 'Property'"/>
1722 </xsl:call-template>
1724 <xsl:attribute name="TypeParameters">
1725 <xsl:call-template name="GetTypeParameterNames">
1726 <xsl:with-param name="member" select="." />
1727 </xsl:call-template>
1729 <xsl:attribute name="Parameters">
1730 <xsl:call-template name="GetParameterTypes">
1731 <xsl:with-param name="member" select="." />
1732 </xsl:call-template>
1734 <xsl:copy-of select="./*" />
1739 <xsl:for-each select="$declaringtype/Members/Member
1740 [(MemberType=$listmembertype or ($listmembertype='Operator' and MemberType='Method'))]
1741 [(not($overloads-mode) or @MemberName=$index or
1742 ($index='Conversion' and (@MemberName='op_Implicit' or @MemberName='op_Explicit'))) ]
1743 [$showprotected=starts-with(MemberSignature[@Language='C#']/@Value, 'protected ')]
1744 [($listmembertype='Method' and not(starts-with(@MemberName,'op_')))
1745 or ($listmembertype='Operator' and starts-with(@MemberName,'op_'))
1746 or (not($listmembertype='Method') and not($listmembertype='Operator'))]
1747 [$showstatic or not(contains(MemberSignature[@Language='C#']/@Value,' static '))]
1748 [$listmembertype = 'Constructor' or not(contains(@MemberName, '.'))]
1750 <Member MemberName="{@MemberName}">
1751 <xsl:attribute name="ExplicitMemberName">
1752 <xsl:call-template name="GetMemberNameWithoutGenericTypes">
1753 <xsl:with-param name="m" select="@MemberName" />
1754 </xsl:call-template>
1756 <xsl:attribute name="TypeParameters">
1757 <xsl:call-template name="GetTypeParameterNames">
1758 <xsl:with-param name="member" select="." />
1759 </xsl:call-template>
1761 <xsl:attribute name="Parameters">
1762 <xsl:call-template name="GetParameterTypes">
1763 <xsl:with-param name="member" select="." />
1764 </xsl:call-template>
1766 <xsl:copy-of select="./*" />
1773 <xsl:copy-of select="$declaringtype/Docs/typeparam" />
1780 <xsl:if test="not($listmembertype='Constructor') and count($declaringtype/Base/BaseTypeName)=1">
1781 <xsl:variable name="basedocsfile">
1782 <xsl:call-template name="GetLinkTarget">
1783 <xsl:with-param name="type">
1784 <xsl:call-template name="GetEscapedTypeName">
1785 <xsl:with-param name="typename" select="$declaringtype/Base/BaseTypeName" />
1786 </xsl:call-template>
1788 <xsl:with-param name="cref">
1790 <xsl:with-param name="local-suffix" />
1791 <xsl:with-param name="remote"/>
1792 <xsl:with-param name="xmltarget" select='1'/>
1793 </xsl:call-template>
1796 <xsl:if test="not(string($basedocsfile) = '')">
1797 <xsl:call-template name="GetInheritedMembers">
1798 <xsl:with-param name="listmembertype" select="$listmembertype"/>
1799 <xsl:with-param name="showprotected" select="$showprotected"/>
1800 <xsl:with-param name="declaringtype" select="document(string($basedocsfile),.)/Type"/>
1801 <xsl:with-param name="generictypereplacements" select="$declaringtype/Base/BaseTypeArguments/*"/>
1802 <xsl:with-param name="showstatic" select='0'/>
1803 </xsl:call-template>
1808 <xsl:template name="GetMemberNameWithoutGenericTypes">
1809 <xsl:param name="m" />
1811 <xsl:when test="contains ($m, '<')">
1812 <xsl:value-of select="substring-before ($m, '<')" />
1815 <xsl:value-of select="$m" />
1820 <xsl:template name="GetTypeParameterNames">
1821 <xsl:param name="member" />
1823 <xsl:for-each select="$member/TypeParameters/TypeParameter">
1824 <xsl:if test="not(position()=1)">, </xsl:if>
1825 <xsl:value-of select="@Name" />
1829 <xsl:template name="GetParameterTypes">
1830 <xsl:param name="member" />
1832 <xsl:for-each select="$member/Parameters/Parameter">
1833 <xsl:if test="not(position()=1)">, </xsl:if>
1834 <xsl:value-of select="@Type" />
1838 <xsl:template name="ListAllMembers">
1839 <xsl:param name="html-anchor" select="false()" />
1841 <xsl:call-template name="ListMembers">
1842 <xsl:with-param name="listmembertype" select="'Constructor'"/>
1843 <xsl:with-param name="showprotected" select="false()"/>
1844 <xsl:with-param name="html-anchor" select="$html-anchor" />
1845 </xsl:call-template>
1847 <xsl:call-template name="ListMembers">
1848 <xsl:with-param name="listmembertype" select="'Constructor'"/>
1849 <xsl:with-param name="showprotected" select="true()"/>
1850 <xsl:with-param name="html-anchor" select="$html-anchor" />
1851 </xsl:call-template>
1853 <xsl:call-template name="ListMembers">
1854 <xsl:with-param name="listmembertype" select="'Field'"/>
1855 <xsl:with-param name="showprotected" select="false()"/>
1856 <xsl:with-param name="html-anchor" select="$html-anchor" />
1857 </xsl:call-template>
1859 <xsl:call-template name="ListMembers">
1860 <xsl:with-param name="listmembertype" select="'Field'"/>
1861 <xsl:with-param name="showprotected" select="true()"/>
1862 <xsl:with-param name="html-anchor" select="$html-anchor" />
1863 </xsl:call-template>
1865 <xsl:call-template name="ListMembers">
1866 <xsl:with-param name="listmembertype" select="'Property'"/>
1867 <xsl:with-param name="showprotected" select="false()"/>
1868 <xsl:with-param name="html-anchor" select="$html-anchor" />
1869 </xsl:call-template>
1871 <xsl:call-template name="ListMembers">
1872 <xsl:with-param name="listmembertype" select="'Property'"/>
1873 <xsl:with-param name="showprotected" select="true()"/>
1874 <xsl:with-param name="html-anchor" select="$html-anchor" />
1875 </xsl:call-template>
1877 <xsl:call-template name="ListMembers">
1878 <xsl:with-param name="listmembertype" select="'Method'"/>
1879 <xsl:with-param name="showprotected" select="false()"/>
1880 <xsl:with-param name="html-anchor" select="$html-anchor" />
1881 </xsl:call-template>
1883 <xsl:call-template name="ListMembers">
1884 <xsl:with-param name="listmembertype" select="'Method'"/>
1885 <xsl:with-param name="showprotected" select="true()"/>
1886 <xsl:with-param name="html-anchor" select="$html-anchor" />
1887 </xsl:call-template>
1889 <xsl:call-template name="ListMembers">
1890 <xsl:with-param name="listmembertype" select="'Event'"/>
1891 <xsl:with-param name="showprotected" select="false()"/>
1892 <xsl:with-param name="html-anchor" select="$html-anchor" />
1893 </xsl:call-template>
1895 <xsl:call-template name="ListMembers">
1896 <xsl:with-param name="listmembertype" select="'Event'"/>
1897 <xsl:with-param name="showprotected" select="true()"/>
1898 <xsl:with-param name="html-anchor" select="$html-anchor" />
1899 </xsl:call-template>
1901 <xsl:call-template name="ListMembers">
1902 <xsl:with-param name="listmembertype" select="'Operator'"/>
1903 <xsl:with-param name="showprotected" select="false()"/>
1904 <xsl:with-param name="html-anchor" select="$html-anchor" />
1905 </xsl:call-template>
1907 <xsl:call-template name="ListMembers">
1908 <xsl:with-param name="listmembertype" select="'Explicit'"/>
1909 <xsl:with-param name="showprotected" select="true()"/>
1910 <xsl:with-param name="html-anchor" select="$html-anchor" />
1911 </xsl:call-template>
1913 <xsl:call-template name="ListMembers">
1914 <xsl:with-param name="listmembertype" select="'ExtensionMethod'"/>
1915 <xsl:with-param name="showprotected" select="false()"/>
1916 <xsl:with-param name="html-anchor" select="$html-anchor" />
1917 </xsl:call-template>
1920 <!-- Lists the members in the current Type node.
1921 Only lists members of type listmembertype.
1922 Displays the signature in siglanguage.
1923 showprotected = true() or false()
1925 <xsl:template name="ListMembers">
1926 <xsl:param name="listmembertype"/>
1927 <xsl:param name="showprotected"/>
1928 <xsl:param name="overloads-mode" select="false()" />
1929 <xsl:param name="html-anchor" select="false()" />
1931 <!-- get name and namespace of current type -->
1932 <xsl:variable name="TypeFullName" select="@FullName"/>
1933 <xsl:variable name="TypeName" select="@Name"/>
1934 <xsl:variable name="TypeNamespace" select="substring-before(@FullName, concat('.',@Name))"/>
1936 <xsl:variable name="MEMBERS-rtf">
1937 <xsl:call-template name="GetInheritedMembers">
1938 <xsl:with-param name="listmembertype" select="$listmembertype"/>
1939 <xsl:with-param name="showprotected" select="$showprotected"/>
1940 <xsl:with-param name="declaringtype" select="."/>
1941 <xsl:with-param name="overloads-mode" select="$overloads-mode" />
1942 </xsl:call-template>
1944 <xsl:variable name="MEMBERS" select="msxsl:node-set($MEMBERS-rtf)" />
1947 <xsl:variable name="MEMBERS" select="
1949 [(MemberType=$listmembertype or ($listmembertype='Operator' and MemberType='Method'))]
1950 [$showprotected=contains(MemberSignature[@Language='C#']/@Value,'protected')]
1951 [($listmembertype='Method' and not(starts-with(@MemberName,'op_')))
1952 or ($listmembertype='Operator' and starts-with(@MemberName,'op_'))
1953 or (not($listmembertype='Method') and not($listmembertype='Operator'))]
1957 <!-- if there aren't any, skip this -->
1958 <xsl:if test="count($MEMBERS//Member)">
1960 <xsl:variable name="SectionName">
1961 <xsl:if test="$listmembertype != 'Explicit' and $listmembertype != 'ExtensionMethod'">
1962 <xsl:if test="$showprotected">Protected </xsl:if>
1963 <xsl:if test="not($showprotected)">Public </xsl:if>
1965 <xsl:call-template name="membertypeplural"><xsl:with-param name="name" select="$listmembertype"/></xsl:call-template>
1969 <xsl:call-template name="CreateH2Section">
1970 <xsl:with-param name="name" select="$SectionName" />
1971 <xsl:with-param name="child-id" select="$SectionName" />
1972 <xsl:with-param name="content">
1973 <div class="SubsectionBox">
1974 <xsl:call-template name="CreateMembersTable">
1975 <xsl:with-param name="content">
1977 <xsl:for-each select="$MEMBERS/Members/Member">
1978 <!--<xsl:sort select="contains(MemberSignature[@Language='C#']/@Value,' static ')" data-type="text"/>-->
1979 <xsl:sort select="@MemberName = 'op_Implicit' or @MemberName = 'op_Explicit'"/>
1980 <xsl:sort select="@ExplicitMemberName" data-type="text"/>
1981 <xsl:sort select="count(TypeParameters/TypeParameter)"/>
1982 <xsl:sort select="@TypeParameters"/>
1983 <xsl:sort select="count(Parameters/Parameter)"/>
1984 <xsl:sort select="@Parameters"/>
1986 <xsl:variable name="local-id">
1988 <xsl:when test="count(Link) = 1">
1989 <xsl:value-of select="Link/@Member" />
1992 <xsl:call-template name="GetLinkId" >
1993 <xsl:with-param name="type" select="parent::Members" />
1994 <xsl:with-param name="member" select="." />
1995 </xsl:call-template>
2000 <xsl:variable name="linkfile">
2001 <xsl:if test="not(parent::Members/@FullName = $TypeFullName)">
2002 <xsl:call-template name="GetLinkTargetHtml">
2003 <xsl:with-param name="type">
2005 <xsl:when test="count(Link) = 1">
2006 <xsl:value-of select="Link/@Type"/>
2009 <xsl:call-template name="GetEscapedTypeName">
2010 <xsl:with-param name="typename" select="parent::Members/@FullName" />
2011 </xsl:call-template>
2015 <xsl:with-param name="cref" />
2016 </xsl:call-template>
2020 <xsl:variable name="linkid">
2021 <xsl:if test="$html-anchor">
2022 <xsl:value-of select="$linkfile" />
2023 <xsl:text>#</xsl:text>
2025 <xsl:value-of select="$local-id" />
2028 <xsl:variable name="isinherited">
2029 <xsl:if test="$listmembertype != 'ExtensionMethod' and not(parent::Members/@FullName = $TypeFullName)">
2030 <xsl:text> (</xsl:text>
2032 <xsl:text>Inherited from </xsl:text>
2033 <xsl:call-template name="maketypelink">
2034 <xsl:with-param name="type" select="parent::Members/@FullName"/>
2035 <xsl:with-param name="wrt" select="$TypeNamespace"/>
2036 </xsl:call-template>
2037 <xsl:text>.</xsl:text>
2039 <xsl:text>)</xsl:text>
2045 <!-- random info -->
2047 <!-- check if it has get and set accessors -->
2048 <xsl:if test="MemberType='Property' and not(contains(MemberSignature[@Language='C#']/@Value, 'set;'))">
2049 <xsl:text>[read-only]</xsl:text>
2051 <xsl:if test="MemberType='Property' and not(contains(MemberSignature[@Language='C#']/@Value, 'get;'))">
2052 <xsl:text>[write-only]</xsl:text>
2055 <xsl:if test="contains(MemberSignature[@Language='C#']/@Value,'this[')">
2056 <div><i>default property</i></div>
2060 <xsl:call-template name="getmodifiers">
2061 <xsl:with-param name="sig" select="MemberSignature[@Language='C#']/@Value"/>
2062 <xsl:with-param name="protection" select="false()"/>
2063 <xsl:with-param name="inheritance" select="true()"/>
2064 <xsl:with-param name="extra" select="false()"/>
2065 </xsl:call-template>
2070 <!-- constructor listing -->
2071 <xsl:when test="MemberType='Constructor'">
2072 <!-- link to constructor page -->
2076 <a href="{$linkid}">
2077 <xsl:call-template name="GetConstructorName">
2078 <xsl:with-param name="type" select="parent::Members" />
2079 <xsl:with-param name="ctor" select="." />
2080 </xsl:call-template>
2084 <!-- argument list -->
2085 <xsl:value-of select="'('"/>
2086 <xsl:for-each select="Parameters/Parameter">
2087 <xsl:if test="not(position()=1)">, </xsl:if>
2089 <xsl:call-template name="ShowParameter">
2090 <xsl:with-param name="Param" select="."/>
2091 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2092 <xsl:with-param name="prototype" select="true()"/>
2093 </xsl:call-template>
2095 <xsl:value-of select="')'"/>
2098 <!-- TODO: $implemented? -->
2103 <xsl:when test="$listmembertype = 'Explicit'">
2105 <a href="{$linkid}">
2107 <xsl:call-template name="GetMemberDisplayName">
2108 <xsl:with-param name="memberName" select="@MemberName" />
2109 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2110 </xsl:call-template>
2116 <!-- field, property and event listing -->
2117 <xsl:when test="MemberType='Field' or MemberType='Property' or MemberType='Event'">
2120 <!-- link to member page -->
2122 <a href="{$linkid}">
2123 <xsl:call-template name="GetMemberDisplayName">
2124 <xsl:with-param name="memberName" select="@MemberName" />
2125 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2126 </xsl:call-template>
2130 <!-- argument list for accessors -->
2131 <xsl:if test="Parameters/Parameter">
2132 <xsl:value-of select="'('"/>
2133 <xsl:for-each select="Parameters/Parameter">
2134 <xsl:if test="not(position()=1)">, </xsl:if>
2136 <xsl:call-template name="ShowParameter">
2137 <xsl:with-param name="Param" select="."/>
2138 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2139 <xsl:with-param name="prototype" select="true()"/>
2140 </xsl:call-template>
2143 <xsl:value-of select="')'"/>
2149 <!-- method listing -->
2150 <xsl:when test="$listmembertype='Method' or $listmembertype = 'ExtensionMethod'">
2153 <!-- link to method page -->
2155 <a href="{$linkid}">
2156 <xsl:call-template name="GetMemberDisplayName">
2157 <xsl:with-param name="memberName" select="@MemberName" />
2158 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2159 </xsl:call-template>
2163 <!-- argument list -->
2164 <xsl:value-of select="'('"/>
2165 <xsl:for-each select="Parameters/Parameter">
2166 <xsl:if test="not(position()=1)">, </xsl:if>
2168 <xsl:call-template name="ShowParameter">
2169 <xsl:with-param name="Param" select="."/>
2170 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2171 <xsl:with-param name="prototype" select="true()"/>
2172 </xsl:call-template>
2175 <xsl:value-of select="')'"/>
2177 <!-- return type -->
2178 <xsl:if test="not(ReturnValue/ReturnType='System.Void')">
2180 <xsl:text> : </xsl:text>
2181 <xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates>
2186 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
2187 <xsl:copy-of select="$isinherited"/>
2192 <xsl:when test="$listmembertype='Operator'">
2195 <!-- link to operator page -->
2197 <xsl:when test="@MemberName='op_Implicit' or @MemberName='op_Explicit'">
2199 <a href="{$linkid}">
2200 <xsl:text>Conversion</xsl:text>
2202 <xsl:when test="ReturnValue/ReturnType = //Type/@FullName">
2203 <xsl:text> From </xsl:text>
2204 <xsl:value-of select="Parameters/Parameter/@Type"/>
2207 <xsl:text> to </xsl:text>
2208 <xsl:value-of select="ReturnValue/ReturnType"/>
2215 <xsl:when test="@MemberName='op_Implicit'">
2216 <xsl:text>(Implicit)</xsl:text>
2219 <xsl:text>(Explicit)</xsl:text>
2223 <xsl:when test="count(Parameters/Parameter)=1">
2225 <a href="{$linkid}">
2226 <xsl:value-of select="substring-after(@MemberName, 'op_')"/>
2232 <a href="{$linkid}">
2233 <xsl:value-of select="substring-after(@MemberName, 'op_')"/>
2236 <xsl:value-of select="'('"/>
2237 <xsl:for-each select="Parameters/Parameter">
2238 <xsl:if test="not(position()=1)">, </xsl:if>
2240 <xsl:call-template name="ShowParameter">
2241 <xsl:with-param name="Param" select="."/>
2242 <xsl:with-param name="TypeNamespace" select="$TypeNamespace"/>
2243 <xsl:with-param name="prototype" select="true()"/>
2244 </xsl:call-template>
2247 <xsl:value-of select="')'"/>
2254 <!-- Other types: just provide a link -->
2256 <a href="{$linkid}">
2257 <xsl:call-template name="GetMemberDisplayName">
2258 <xsl:with-param name="memberName" select="@MemberName" />
2259 <xsl:with-param name="isproperty" select="MemberType='Property'" />
2260 </xsl:call-template>
2266 <xsl:if test="$listmembertype != 'Method' and $listmembertype != 'ExtensionMethod'">
2268 <!-- description -->
2269 <xsl:if test="MemberType='Field' or MemberType = 'Property'">
2270 <i><xsl:apply-templates select="ReturnValue/ReturnType" mode="typelink"><xsl:with-param name="wrt" select="$TypeNamespace"/></xsl:apply-templates></i>
2271 <xsl:if test="MemberValue"> (<xsl:value-of select="MemberValue"/>)</xsl:if>
2272 <xsl:text>. </xsl:text>
2275 <xsl:apply-templates select="Docs/summary" mode="notoppara"/>
2276 <xsl:copy-of select="$isinherited"/>
2284 </xsl:call-template>
2287 </xsl:call-template>
2293 <xsl:template name="GetLinkName">
2294 <xsl:param name="type"/>
2295 <xsl:param name="member"/>
2296 <xsl:call-template name="memberlinkprefix">
2297 <xsl:with-param name="member" select="$member"/>
2298 </xsl:call-template>
2299 <xsl:text>:</xsl:text>
2300 <xsl:call-template name="GetEscapedTypeName">
2301 <xsl:with-param name="typename" select="$type/@FullName" />
2302 </xsl:call-template>
2303 <xsl:if test="$member/MemberType != 'Constructor'">
2304 <xsl:text>.</xsl:text>
2305 <xsl:variable name="memberName">
2306 <xsl:call-template name="GetGenericName">
2307 <xsl:with-param name="membername" select="$member/@MemberName" />
2308 <xsl:with-param name="member" select="$member" />
2309 </xsl:call-template>
2311 <xsl:call-template name="Replace">
2312 <xsl:with-param name="s">
2313 <xsl:call-template name="ToBraces">
2314 <xsl:with-param name="s" select="$memberName" />
2315 </xsl:call-template>
2317 <xsl:with-param name="from">.</xsl:with-param>
2318 <xsl:with-param name="to">#</xsl:with-param>
2319 </xsl:call-template>
2323 <xsl:template name="GetGenericName">
2324 <xsl:param name="membername" />
2325 <xsl:param name="member" />
2326 <xsl:variable name="numgenargs" select="count($member/Docs/typeparam)" />
2328 <xsl:when test="$numgenargs = 0">
2329 <xsl:value-of select="$membername" />
2332 <xsl:if test="contains($membername, '<')">
2333 <xsl:value-of select="substring-before ($membername, '<')" />
2335 <xsl:text>``</xsl:text>
2336 <xsl:value-of select="$numgenargs" />
2341 <xsl:template name="GetEscapedTypeName">
2342 <xsl:param name="typename" />
2343 <xsl:variable name="base" select="substring-before ($typename, '<')" />
2346 <xsl:when test="$base != ''">
2347 <xsl:value-of select="translate ($base, '+', '.')" />
2348 <xsl:text>`</xsl:text>
2349 <xsl:call-template name="GetGenericArgumentCount">
2350 <xsl:with-param name="arglist" select="substring-after ($typename, '<')" />
2351 <xsl:with-param name="count">1</xsl:with-param>
2352 </xsl:call-template>
2354 <xsl:otherwise><xsl:value-of select="translate ($typename, '+', '.')" /></xsl:otherwise>
2358 <xsl:template name="GetGenericArgumentCount">
2359 <xsl:param name="arglist" />
2360 <xsl:param name="count" />
2362 <xsl:variable name="rest-rtf">
2363 <xsl:call-template name="SkipTypeArgument">
2364 <xsl:with-param name="s" select="$arglist" />
2365 </xsl:call-template>
2367 <xsl:variable name="rest" select="string($rest-rtf)" />
2370 <xsl:when test="$arglist != '' and $rest = ''">
2371 <xsl:value-of select="$count" />
2373 <xsl:when test="$arglist = '' and $rest = ''">
2374 <xsl:message terminate="yes">
2375 !WTF? arglist=<xsl:value-of select="$arglist" />; rest=<xsl:value-of select="$rest" />
2378 <xsl:when test="starts-with ($rest, '>')">
2379 <xsl:value-of select="$count" />
2380 <xsl:call-template name="GetEscapedTypeName">
2381 <xsl:with-param name="typename" select="substring-after ($rest, '>')" />
2382 </xsl:call-template>
2384 <xsl:when test="starts-with ($rest, ',')">
2385 <xsl:call-template name="GetGenericArgumentCount">
2386 <xsl:with-param name="arglist" select="substring-after ($rest, ',')" />
2387 <xsl:with-param name="count" select="$count+1" />
2388 </xsl:call-template>
2391 <xsl:message terminate="yes">
2392 !WTF 2? arglist=<xsl:value-of select="$arglist" />; rest=<xsl:value-of select="$rest" />
2398 <xsl:template name="SkipTypeArgument">
2399 <xsl:param name="s" />
2401 <xsl:variable name="p-rtf">
2402 <xsl:call-template name="GetCLtGtPositions">
2403 <xsl:with-param name="s" select="$s" />
2404 </xsl:call-template>
2406 <xsl:variable name="p" select="msxsl:node-set($p-rtf)"/>
2410 Have to select between three `s' patterns:
2411 A,B>: need to return ",B>"
2412 Foo<A,B>>: Need to forward to SkipGenericArgument to eventually return ">"
2413 Foo<A,B>+C>: Need to forward to SkipGenericArgument to eventually return ">"
2415 <xsl:when test="starts-with ($s, '>')">
2416 <xsl:message terminate="yes">
2417 SkipTypeArgument: invalid type substring '<xsl:value-of select="$s" />'
2420 <xsl:when test="$p/Comma/@Length > 0 and
2421 ($p/Lt/@Length = 0 or $p/Comma/@Length < $p/Lt/@Length) and
2422 ($p/Gt/@Length > 0 and $p/Comma/@Length < $p/Gt/@Length)">
2423 <xsl:text>,</xsl:text>
2424 <xsl:value-of select="substring-after ($s, ',')" />
2426 <xsl:when test="$p/Lt/@Length > 0 and $p/Lt/@Length < $p/Gt/@Length">
2427 <xsl:variable name="r">
2428 <xsl:call-template name="SkipGenericArgument">
2429 <xsl:with-param name="s" select="substring-after ($s, '<')" />
2430 </xsl:call-template>
2433 <xsl:when test="starts-with ($r, '>') or starts-with ($r, '+')">
2434 <xsl:value-of select="substring-after ($r, '>')" />
2436 <xsl:when test="starts-with ($r, ',')">
2437 <xsl:value-of select="$r" />
2441 ! WTF3: s=<xsl:value-of select="$s" />; r=<xsl:value-of select="$r" />
2446 <xsl:when test="$p/Gt/@Length > 0">
2447 <xsl:text>></xsl:text>
2448 <xsl:value-of select="substring-after ($s, '>')" />
2450 <xsl:otherwise><xsl:value-of select="$s" /></xsl:otherwise>
2454 <xsl:template name="GetCLtGtPositions">
2455 <xsl:param name="s" />
2457 <xsl:variable name="c" select="substring-before ($s, ',')" />
2458 <xsl:variable name="lt" select="substring-before ($s, '<')" />
2459 <xsl:variable name="gt" select="substring-before ($s, '>')" />
2461 <Comma String="{$c}" Length="{string-length ($c)}" />
2462 <Lt String="{$lt}" Length="{string-length ($lt)}" />
2463 <Gt String="{$gt}" Length="{string-length ($gt)}" />
2467 when given 'Foo<A,Bar<Baz<C,D,E>>>>', returns '>'
2468 when given 'Bar<C>+Nested>', returns '>'
2469 when given 'Foo<A,Bar<Baz<C,D,E>>>,', returns ','
2470 (basically, it matches '<' to '>' and "skips" the intermediate type-name contents.
2472 <xsl:template name="SkipGenericArgument">
2473 <xsl:param name="s" />
2475 <xsl:variable name="p-rtf">
2476 <xsl:call-template name="GetCLtGtPositions">
2477 <xsl:with-param name="s" select="$s" />
2478 </xsl:call-template>
2480 <xsl:variable name="p" select="msxsl:node-set($p-rtf)" />
2483 <xsl:when test="starts-with ($s, '>')">
2484 <xsl:message terminate="yes">
2485 SkipGenericArgument: invalid type substring '<xsl:value-of select="$s" />'
2488 <xsl:when test="$p/Lt/@Length > 0 and $p/Lt/@Length < $p/Gt/@Length">
2489 <!-- within 'Foo<A...'; look for matching '>' -->
2490 <xsl:variable name="r">
2491 <xsl:call-template name="SkipGenericArgument">
2492 <xsl:with-param name="s" select="substring-after ($s, '<')" />
2493 </xsl:call-template>
2495 <xsl:value-of select="substring-after ($r, '>')" />
2497 <xsl:when test="$p/Gt/@Length > 0">
2498 <!--<xsl:value-of select="substring ($s, string-length ($gt)+1)" />-->
2499 <xsl:value-of select="substring-after ($s, '>')" />
2502 <xsl:value-of select="$s" />
2507 <xsl:template name="GetEscapedParameter">
2508 <xsl:param name="orig-parameter-type" />
2509 <xsl:param name="parameter-type" />
2510 <xsl:param name="parameter-types" />
2511 <xsl:param name="escape" />
2512 <xsl:param name="index" />
2515 <xsl:when test="$index > count($parameter-types)">
2516 <xsl:if test="$parameter-type != $orig-parameter-type">
2517 <xsl:value-of select="$parameter-type" />
2521 <xsl:when test="$parameter-types[position() = $index]/@name = $parameter-type">
2522 <xsl:value-of select="concat ($escape, $index - 1)" />
2525 <xsl:variable name="typeparam" select="$parameter-types[position() = $index]/@name" />
2526 <xsl:call-template name="GetEscapedParameter">
2527 <xsl:with-param name="orig-parameter-type" select="$orig-parameter-type" />
2528 <xsl:with-param name="parameter-type">
2529 <xsl:call-template name="Replace">
2530 <xsl:with-param name="s">
2531 <xsl:call-template name="Replace">
2532 <xsl:with-param name="s">
2533 <xsl:call-template name="Replace">
2534 <xsl:with-param name="s">
2535 <xsl:call-template name="Replace">
2536 <xsl:with-param name="s" select="$parameter-type"/>
2537 <xsl:with-param name="from" select="concat('<', $typeparam, '>')" />
2538 <xsl:with-param name="to" select="concat('<', $escape, $index - 1, '>')" />
2539 </xsl:call-template>
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="parameter-types" select="$parameter-types" />
2554 <xsl:with-param name="typeparam" select="$typeparam" />
2555 <xsl:with-param name="escape" select="$escape" />
2556 <xsl:with-param name="index" select="$index + 1" />
2557 </xsl:call-template>
2562 <xsl:template name="GetLinkId">
2563 <xsl:param name="type"/>
2564 <xsl:param name="member"/>
2565 <xsl:call-template name="GetLinkName">
2566 <xsl:with-param name="type" select="$type" />
2567 <xsl:with-param name="member" select="$member" />
2568 </xsl:call-template>
2569 <xsl:if test="count($member/Parameters/Parameter) > 0 or $member/MemberType='Method' or $member/MemberType='Constructor'">
2570 <xsl:text>(</xsl:text>
2571 <xsl:for-each select="Parameters/Parameter">
2572 <xsl:if test="not(position()=1)">,</xsl:if>
2573 <xsl:call-template name="GetParameterType">
2574 <xsl:with-param name="type" select="$type" />
2575 <xsl:with-param name="member" select="$member" />
2576 <xsl:with-param name="parameter" select="." />
2577 </xsl:call-template>
2579 <xsl:text>)</xsl:text>
2581 <xsl:if test="$member/@MemberName='op_Implicit' or $member/@MemberName='op_Explicit'">
2582 <xsl:text>~</xsl:text>
2583 <xsl:variable name="parameter-rtf">
2584 <Parameter Type="{$member/ReturnValue/ReturnType}" />
2586 <xsl:call-template name="GetParameterType">
2587 <xsl:with-param name="type" select="$type" />
2588 <xsl:with-param name="member" select="$member" />
2589 <xsl:with-param name="parameter" select="msxsl:node-set($parameter-rtf)/Parameter" />
2590 </xsl:call-template>
2595 - what should be <xsl:value-of select="@Type" /> becomes a nightmare once
2596 - generics enter the picture, since a parameter type could come from the
2597 - type itelf (becoming `N) or from the method (becoming ``N).
2599 <xsl:template name="GetParameterType">
2600 <xsl:param name="type" />
2601 <xsl:param name="member" />
2602 <xsl:param name="parameter" />
2604 <!-- the actual parameter type -->
2605 <xsl:variable name="ptype">
2607 <xsl:when test="contains($parameter/@Type, '[')">
2608 <xsl:value-of select="substring-before ($parameter/@Type, '[')" />
2610 <xsl:when test="contains($parameter/@Type, '&')">
2611 <xsl:value-of select="substring-before ($parameter/@Type, '&')" />
2613 <xsl:when test="contains($parameter/@Type, '*')">
2614 <xsl:value-of select="substring-before ($parameter/@Type, '*')" />
2617 <xsl:value-of select="$parameter/@Type" />
2622 <!-- parameter modifiers -->
2623 <xsl:variable name="pmodifier">
2624 <xsl:call-template name="Replace">
2625 <xsl:with-param name="s" select="substring-after ($parameter/@Type, $ptype)" />
2626 <xsl:with-param name="from">&</xsl:with-param>
2627 <xsl:with-param name="to">@</xsl:with-param>
2628 </xsl:call-template>
2631 <xsl:variable name="gen-type">
2632 <xsl:call-template name="GetEscapedParameter">
2633 <xsl:with-param name="orig-parameter-type" select="$ptype" />
2634 <xsl:with-param name="parameter-type">
2635 <xsl:variable name="nested">
2636 <xsl:call-template name="GetEscapedParameter">
2637 <xsl:with-param name="orig-parameter-type" select="$ptype" />
2638 <xsl:with-param name="parameter-type" select="$ptype" />
2639 <xsl:with-param name="parameter-types" select="$type/Docs/typeparam" />
2640 <xsl:with-param name="escape" select="'`'" />
2641 <xsl:with-param name="index" select="1" />
2642 </xsl:call-template>
2645 <xsl:when test="$nested != ''">
2646 <xsl:value-of select="$nested" />
2649 <xsl:value-of select="$ptype" />
2653 <xsl:with-param name="parameter-types" select="$member/Docs/typeparam" />
2654 <xsl:with-param name="escape" select="'``'" />
2655 <xsl:with-param name="index" select="1" />
2656 </xsl:call-template>
2659 <!-- the actual parameter type -->
2660 <xsl:variable name="parameter-type">
2662 <xsl:when test="$gen-type != ''">
2663 <xsl:value-of select="$gen-type" />
2664 <xsl:value-of select="$pmodifier" />
2667 <xsl:value-of select="concat($ptype, $pmodifier)" />
2672 <!-- s/</{/g; s/>/}/g; so that less escaping is needed. -->
2673 <xsl:call-template name="Replace">
2674 <xsl:with-param name="s">
2675 <xsl:call-template name="Replace">
2676 <xsl:with-param name="s" select="translate ($parameter-type, '+', '.')" />
2677 <xsl:with-param name="from">></xsl:with-param>
2678 <xsl:with-param name="to">}</xsl:with-param>
2679 </xsl:call-template>
2681 <xsl:with-param name="from"><</xsl:with-param>
2682 <xsl:with-param name="to">{</xsl:with-param>
2683 </xsl:call-template>
2686 <xsl:template name="Replace">
2687 <xsl:param name="s" />
2688 <xsl:param name="from" />
2689 <xsl:param name="to" />
2691 <xsl:when test="not(contains($s, $from))">
2692 <xsl:value-of select="$s" />
2695 <xsl:variable name="prefix" select="substring-before($s, $from)"/>
2696 <xsl:variable name="suffix" select="substring-after($s, $from)" />
2697 <xsl:value-of select="$prefix" />
2698 <xsl:value-of select="$to" />
2699 <xsl:call-template name="Replace">
2700 <xsl:with-param name="s" select="$suffix" />
2701 <xsl:with-param name="from" select="$from" />
2702 <xsl:with-param name="to" select="$to" />
2703 </xsl:call-template>
2708 <xsl:template name="getmodifiers">
2709 <xsl:param name="sig"/>
2710 <xsl:param name="protection" select="true()"/>
2711 <xsl:param name="inheritance" select="true()"/>
2712 <xsl:param name="extra" select="true()"/>
2713 <xsl:param name="typetype" select="false()"/>
2715 <xsl:variable name="Sig">
2716 <xsl:text> </xsl:text>
2718 <xsl:when test="contains($sig, '{')">
2719 <xsl:value-of select="substring-before ($sig, '{')" />
2722 <xsl:value-of select="$sig" />
2725 <xsl:text> </xsl:text>
2728 <xsl:if test="$protection">
2729 <xsl:if test="contains($Sig, ' public ')">public </xsl:if>
2730 <xsl:if test="contains($Sig, ' private ')">private </xsl:if>
2731 <xsl:if test="contains($Sig, ' protected ')">protected </xsl:if>
2732 <xsl:if test="contains($Sig, ' internal ')">internal </xsl:if>
2735 <xsl:if test="contains($Sig, ' static ')">static </xsl:if>
2736 <xsl:if test="contains($Sig, ' abstract ')">abstract </xsl:if>
2737 <xsl:if test="contains($Sig, ' operator ')">operator </xsl:if>
2739 <xsl:if test="contains($Sig, ' const ')">const </xsl:if>
2740 <xsl:if test="contains($Sig, ' readonly ')">readonly </xsl:if>
2742 <xsl:if test="$inheritance">
2743 <xsl:if test="contains($Sig, ' override ')">override </xsl:if>
2744 <xsl:if test="contains($Sig, ' new ')">new </xsl:if>
2747 <xsl:if test="$extra">
2748 <xsl:if test="contains($Sig, ' sealed ')">sealed </xsl:if>
2749 <xsl:if test="contains($Sig, ' virtual ')">virtual </xsl:if>
2751 <xsl:if test="contains($Sig, ' extern ')">extern </xsl:if>
2752 <xsl:if test="contains($Sig, ' checked ')">checked </xsl:if>
2753 <xsl:if test="contains($Sig, ' unsafe ')">unsafe </xsl:if>
2754 <xsl:if test="contains($Sig, ' volatile ')">volatile </xsl:if>
2755 <xsl:if test="contains($Sig, ' explicit ')">explicit </xsl:if>
2756 <xsl:if test="contains($Sig, ' implicit ')">implicit </xsl:if>
2759 <xsl:if test="$typetype">
2760 <xsl:if test="contains($Sig, ' class ')">class </xsl:if>
2761 <xsl:if test="contains($Sig, ' interface ')">interface </xsl:if>
2762 <xsl:if test="contains($Sig, ' struct ')">struct </xsl:if>
2763 <xsl:if test="contains($Sig, ' delegate ')">delegate </xsl:if>
2764 <xsl:if test="contains($Sig, ' enum ')">enum </xsl:if>
2768 <xsl:template name="GetTypeDescription">
2769 <xsl:variable name="sig" select="TypeSignature[@Language='C#']/@Value"/>
2771 <xsl:when test="contains($sig, ' class ')">Class</xsl:when>
2772 <xsl:when test="contains($sig, ' interface ')">Interface</xsl:when>
2773 <xsl:when test="contains($sig, ' struct ')">Struct</xsl:when>
2774 <xsl:when test="contains($sig, ' delegate ')">Delegate</xsl:when>
2775 <xsl:when test="contains($sig, ' enum ')">Enum</xsl:when>
2779 <xsl:template match="since">
2781 <i>Note: This namespace, class, or member is supported only in version <xsl:value-of select="@version" />
2786 <xsl:template name="GetLinkTargetHtml">
2787 <xsl:param name="type" />
2788 <xsl:param name="cref" />
2790 <xsl:variable name="href">
2791 <xsl:call-template name="GetLinkTarget">
2792 <xsl:with-param name="type" select="$type" />
2793 <xsl:with-param name="cref" select="$cref" />
2794 </xsl:call-template>
2797 <xsl:when test="string($href) = ''">
2798 <xsl:text>javascript:alert("Documentation not found.")</xsl:text>
2800 <xsl:otherwise><xsl:value-of select="$href" /></xsl:otherwise>