summaryrefslogtreecommitdiffstats
path: root/tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/CPlusPlusDeclarationSyntax.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-09-20 21:45:59 -0700
committerAndrew Arnott <andrewarnott@gmail.com>2009-09-21 08:06:25 -0700
commite4e6423ed5f5ba51c500780b5ce72fcd64d63156 (patch)
treecded6512b7591e569aeeb78419ca0007f7dced01 /tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/CPlusPlusDeclarationSyntax.cs
parentbbe3f9cc9c8a1e5909273c1a162a63ea7a66afd8 (diff)
downloadDotNetOpenAuth-e4e6423ed5f5ba51c500780b5ce72fcd64d63156.zip
DotNetOpenAuth-e4e6423ed5f5ba51c500780b5ce72fcd64d63156.tar.gz
DotNetOpenAuth-e4e6423ed5f5ba51c500780b5ce72fcd64d63156.tar.bz2
Upgraded to latest Sandcastle changeset (26202).
Diffstat (limited to 'tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/CPlusPlusDeclarationSyntax.cs')
-rw-r--r--tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/CPlusPlusDeclarationSyntax.cs39
1 files changed, 33 insertions, 6 deletions
diff --git a/tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/CPlusPlusDeclarationSyntax.cs b/tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/CPlusPlusDeclarationSyntax.cs
index ee6cff5..56c6316 100644
--- a/tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/CPlusPlusDeclarationSyntax.cs
+++ b/tools/Sandcastle/Source/BuildAssembler/SyntaxComponents/CPlusPlusDeclarationSyntax.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.Collections.Generic;
using System.Xml.XPath;
@@ -10,7 +13,7 @@ namespace Microsoft.Ddue.Tools {
public class CPlusPlusDeclarationSyntaxGenerator : SyntaxGeneratorTemplate {
public CPlusPlusDeclarationSyntaxGenerator (XPathNavigator configuration) : base(configuration) {
- if (String.IsNullOrEmpty(language)) language = "ManagedCPlusPlus";
+ if (String.IsNullOrEmpty(Language)) Language = "ManagedCPlusPlus";
}
// namespace: done
@@ -326,7 +329,7 @@ namespace Microsoft.Ddue.Tools {
} else if (name == "Explicit") {
writer.WriteKeyword("explicit operator");
} else {
- throw new Exception();
+ throw new InvalidOperationException("invalid cast type: " + name);
}
writer.WriteString(" ");
WriteReturnValue(reflection, writer);
@@ -370,6 +373,16 @@ namespace Microsoft.Ddue.Tools {
if (hasGetter) {
writer.WriteString("\t");
+
+ //write the get visibility
+ string getVisibility = (string)reflection.Evaluate(apiGetVisibilityExpression);
+ if (!String.IsNullOrEmpty(getVisibility))
+ {
+ WriteVisibility(getVisibility, writer);
+ writer.WriteString(":");
+ writer.WriteString(" ");
+ }
+
WriteReturnValue(reflection, writer);
writer.WriteString(" ");
writer.WriteKeyword("get");
@@ -399,6 +412,16 @@ namespace Microsoft.Ddue.Tools {
if (hasSetter) {
writer.WriteString("\t");
+
+ // write the set visibility
+ string setVisibility = (string)reflection.Evaluate(apiSetVisibilityExpression);
+ if (!String.IsNullOrEmpty(setVisibility))
+ {
+ WriteVisibility(setVisibility, writer);
+ writer.WriteString(":");
+ writer.WriteString(" ");
+ }
+
writer.WriteKeyword("void");
writer.WriteString(" ");
writer.WriteKeyword("set");
@@ -571,9 +594,13 @@ namespace Microsoft.Ddue.Tools {
}
- private void WriteVisibility (XPathNavigator reflection, SyntaxWriter writer) {
+ private void WriteVisibility(XPathNavigator reflection, SyntaxWriter writer) {
+
+ string visibility = reflection.Evaluate(apiVisibilityExpression).ToString();
+ WriteVisibility(visibility, writer);
+ }
- string visibility = reflection.Evaluate(apiVisibilityExpression).ToString();
+ private void WriteVisibility (string visibility, SyntaxWriter writer) {
switch (visibility) {
case "public":