diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2009-09-20 21:45:59 -0700 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2009-09-21 08:06:25 -0700 |
commit | e4e6423ed5f5ba51c500780b5ce72fcd64d63156 (patch) | |
tree | cded6512b7591e569aeeb78419ca0007f7dced01 /tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/JScriptDeclarationSyntax.cs | |
parent | bbe3f9cc9c8a1e5909273c1a162a63ea7a66afd8 (diff) | |
download | DotNetOpenAuth-e4e6423ed5f5ba51c500780b5ce72fcd64d63156.zip DotNetOpenAuth-e4e6423ed5f5ba51c500780b5ce72fcd64d63156.tar.gz DotNetOpenAuth-e4e6423ed5f5ba51c500780b5ce72fcd64d63156.tar.bz2 |
Upgraded to latest Sandcastle changeset (26202).
Diffstat (limited to 'tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/JScriptDeclarationSyntax.cs')
-rw-r--r-- | tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/JScriptDeclarationSyntax.cs | 57 |
1 files changed, 52 insertions, 5 deletions
diff --git a/tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/JScriptDeclarationSyntax.cs b/tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/JScriptDeclarationSyntax.cs index 543936c..27ac11d 100644 --- a/tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/JScriptDeclarationSyntax.cs +++ b/tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/JScriptDeclarationSyntax.cs @@ -1,5 +1,8 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// +// Copyright © Microsoft Corporation. +// This source file is subject to the Microsoft Permissive License. +// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx. +// All other rights reserved. + using System; using System.Xml.XPath; @@ -9,7 +12,7 @@ namespace Microsoft.Ddue.Tools { public class JScriptDeclarationSyntaxGenerator : SyntaxGeneratorTemplate { public JScriptDeclarationSyntaxGenerator (XPathNavigator configuration) : base(configuration) { - if (String.IsNullOrEmpty(language)) language = "JScript"; + if (String.IsNullOrEmpty(Language)) Language = "JScript"; } public override void WriteNamespaceSyntax (XPathNavigator reflection, SyntaxWriter writer) { @@ -130,6 +133,14 @@ namespace Microsoft.Ddue.Tools { if (isGettable) { WriteAttributeList(reflection, writer); + + string getVisibility = (string)reflection.Evaluate(apiGetVisibilityExpression); + if (!String.IsNullOrEmpty(getVisibility)) + { + WriteVisibility(getVisibility, writer); + writer.WriteString(" "); + } + WriteProcedureModifiers(reflection, writer); writer.WriteKeyword("function get"); writer.WriteString(" "); @@ -141,6 +152,14 @@ namespace Microsoft.Ddue.Tools { if (isSettable) { WriteAttributeList(reflection, writer); + + string setVisibility = (string)reflection.Evaluate(apiSetVisibilityExpression); + if (!String.IsNullOrEmpty(setVisibility)) + { + WriteVisibility(setVisibility, writer); + writer.WriteString(" "); + } + WriteProcedureModifiers(reflection, writer); writer.WriteKeyword("function set"); writer.WriteString(" "); @@ -232,7 +251,10 @@ namespace Microsoft.Ddue.Tools { string typeSubgroup = (string)reflection.Evaluate(apiContainingTypeSubgroupExpression); if (typeSubgroup == "interface") return; - WriteAccessModifier(reflection, writer); + string subgroup = (string)reflection.Evaluate(apiSubgroupExpression); + if (subgroup != "property") { + WriteAccessModifier(reflection, writer); + } // instance or virtual, static or abstract, etc. bool isStatic = (bool)reflection.Evaluate(apiIsStaticExpression); @@ -309,7 +331,7 @@ namespace Microsoft.Ddue.Tools { writer.WriteKeyword("protected"); break; case "family or assembly": - writer.WriteKeyword("protected internal"); + // this isn't handled in JScript break; case "assembly": writer.WriteKeyword("internal"); @@ -424,5 +446,30 @@ namespace Microsoft.Ddue.Tools { // fill in this logic } + private void WriteVisibility(string visibility, SyntaxWriter writer) { + + switch (visibility) { + case "public": + writer.WriteKeyword("public"); + break; + case "family": + writer.WriteKeyword("protected"); + break; + case "family or assembly": + // this isn't handled in JScript + break; + case "assembly": + writer.WriteKeyword("internal"); + break; + case "private": + writer.WriteKeyword("private"); + break; + case "family and assembly": + // this isn't handled in JScript + break; + } + + } + } } |