Targets.cs :  » Development » Sandcastle » Microsoft » Ddue » Tools » C# / CSharp Open Source

Home
C# / CSharp Open Source
1.2.6.4 mono .net core
2.2.6.4 mono core
3.Aspect Oriented Frameworks
4.Bloggers
5.Build Systems
6.Business Application
7.Charting Reporting Tools
8.Chat Servers
9.Code Coverage Tools
10.Content Management Systems CMS
11.CRM ERP
12.Database
13.Development
14.Email
15.Forum
16.Game
17.GIS
18.GUI
19.IDEs
20.Installers Generators
21.Inversion of Control Dependency Injection
22.Issue Tracking
23.Logging Tools
24.Message
25.Mobile
26.Network Clients
27.Network Servers
28.Office
29.PDF
30.Persistence Frameworks
31.Portals
32.Profilers
33.Project Management
34.RSS RDF
35.Rule Engines
36.Script
37.Search Engines
38.Sound Audio
39.Source Control
40.SQL Clients
41.Template Engines
42.Testing
43.UML
44.Web Frameworks
45.Web Service
46.Web Testing
47.Wiki Engines
48.Windows Presentation Foundation
49.Workflows
50.XML Parsers
C# / C Sharp
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source » Development » Sandcastle 
Sandcastle » Microsoft » Ddue » Tools » Targets.cs
// 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);

        }
 
    }

}
www.java2v.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.