summaryrefslogtreecommitdiffstats
path: root/tools/Sandcastle/Source/BuildAssembler/BuildComponents/Targets.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2009-11-01 21:16:29 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2009-11-01 21:16:29 -0800
commit5781c5567294660d803cccc61fb56378806a919f (patch)
tree03781d167b4ec48936fb20e68cdb5fc23fab55c6 /tools/Sandcastle/Source/BuildAssembler/BuildComponents/Targets.cs
parentc36bce9e0f0184ba4d60a8c3a375840d17d181d2 (diff)
parent55d6e4be43225184f9a656e6d9cc8fc1e8e7387b (diff)
downloadDotNetOpenAuth-5781c5567294660d803cccc61fb56378806a919f.zip
DotNetOpenAuth-5781c5567294660d803cccc61fb56378806a919f.tar.gz
DotNetOpenAuth-5781c5567294660d803cccc61fb56378806a919f.tar.bz2
Merge branch 'master' into openidux
Conflicts: src/DotNetOpenAuth.vsmdi src/DotNetOpenAuth/InfoCard/InfoCardSelector.cs src/DotNetOpenAuth/OAuth/ServiceProvider.cs src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyAjaxControlBase.cs src/DotNetOpenAuth/OpenId/RelyingParty/OpenIdRelyingPartyControlBase.cs
Diffstat (limited to 'tools/Sandcastle/Source/BuildAssembler/BuildComponents/Targets.cs')
-rw-r--r--tools/Sandcastle/Source/BuildAssembler/BuildComponents/Targets.cs156
1 files changed, 156 insertions, 0 deletions
diff --git a/tools/Sandcastle/Source/BuildAssembler/BuildComponents/Targets.cs b/tools/Sandcastle/Source/BuildAssembler/BuildComponents/Targets.cs
new file mode 100644
index 0000000..656da13
--- /dev/null
+++ b/tools/Sandcastle/Source/BuildAssembler/BuildComponents/Targets.cs
@@ -0,0 +1,156 @@
+// 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.Text;
+
+using System.Xml;
+using System.Xml.XPath;
+
+namespace BuildComponents {
+
+ public partial class Target {
+
+ internal string id;
+
+ public string Id {
+ get {
+ return (id);
+ }
+ }
+ }
+
+ // Namespace
+
+ public partial class NamespaceTarget : Target {
+
+ internal string name;
+
+ public string Name {
+ get {
+ return (name);
+ }
+ }
+
+ }
+
+ // Type
+
+ public partial class TypeTarget : Target {
+
+ // apidata
+
+ protected string subgroup;
+
+ // containers
+
+ protected NamespaceReference containingNamespace;
+
+ protected SimpleTypeReference containingType;
+
+ protected string containingAssembly;
+
+ // other
+
+ public NamespaceReference Namespace {
+ get {
+ return (containingNamespace);
+ }
+ }
+
+ public SimpleTypeReference OuterType {
+ get {
+ return (containingType);
+ }
+ }
+
+ }
+
+ // Construction of targets from Xml
+
+ public partial class Target {
+
+ public static Target Create (XmlReader api) {
+
+ string id = api.GetAttribute("id");
+
+ Target target = null;
+ api.ReadToFollowing("apidata");
+ string group = api.GetAttribute("group");
+ switch (group) {
+ case "namespace":
+ target = NamespaceTarget.Create(api);
+ break;
+ }
+
+ target.id = id;
+
+ return (target);
+ }
+
+ protected static XPathExpression apiNameExpression = XPathExpression.Compile("string(apidata/@name)");
+
+
+ }
+
+ public partial class NamespaceTarget {
+
+ public static new NamespaceTarget Create (XmlReader apidata) {
+ NamespaceTarget target = new NamespaceTarget();
+ string name = apidata.GetAttribute("name");
+
+ // This is not locale-independent.
+ if (String.IsNullOrEmpty(target.name)) name = "(Default Namespace)";
+
+ target.name = name;
+
+ return (target);
+ }
+
+ public static NamespaceTarget Create (XPathNavigator api) {
+
+ NamespaceTarget target = new NamespaceTarget();
+ target.name = (string)api.Evaluate(apiNameExpression);
+
+ // This is not locale-independent.
+ if (String.IsNullOrEmpty(target.name)) target.name = "(Default Namespace)";
+
+ return (target);
+ }
+
+ }
+
+
+ public partial class TypeTarget {
+
+ public static new TypeTarget Create (XmlReader api) {
+
+ api.ReadToFollowing("apidata");
+ //string subgroup = api.GetAttribute("subgroup");
+
+ api.ReadToFollowing("typedata");
+ //string visibilityValue = api.GetAttribute("visibility");
+ //string abstractValue = api.GetAttribute("abstract");
+ //string sealedValue = api.GetAttribute("sealed");
+ //string serializableValue = api.GetAttribute("serealizable");
+
+ api.ReadToFollowing("library");
+ string containingAssemblyValue = api.GetAttribute("assembly");
+
+ api.ReadToFollowing("namespace");
+ NamespaceReference containingNamespace = NamespaceReference.Create(api);
+
+ TypeTarget target = new TypeTarget();
+ target.containingAssembly = containingAssemblyValue;
+ target.containingNamespace = containingNamespace;
+
+ return (target);
+
+ }
+
+ }
+
+}