NDoc configuration class for NAntDocumenter.
Inheritance: NDoc.Core.Reflection.BaseReflectionDocumenterConfig
        /// <summary>
        /// Initializes a new instance of the <see cref="NAntXsltUtilities" />
        /// class.
        /// </summary>
        private NAntXsltUtilities(XmlDocument doc, NAntDocumenterConfig config)
        {
            _doc = doc;
            _config = config;

            if (config.SdkLinksOnWeb) {
                _sdkDocBaseUrl = MsdnOnlineSdkBaseUrl;
                _sdkDocExt = MsdnOnlineSdkPageExt;
            } else {
                switch (config.SdkDocVersion) {
                    case SdkVersion.SDK_v1_0:
                        _sdkDocBaseUrl = SdkDoc10BaseUrl;
                        _sdkDocExt = SdkDocPageExt;
                        break;
                    case SdkVersion.SDK_v1_1:
                        _sdkDocBaseUrl = SdkDoc11BaseUrl;
                        _sdkDocExt = SdkDocPageExt;
                        break;
                }
            }

            // create a list of element names by id
            XmlNodeList types = Document.SelectNodes("//class");
            foreach (XmlElement typeNode in types) {
                string typeId = typeNode.Attributes["id"].Value;
                _elementNames[typeId] = GetElementNameForType(typeNode);

                XmlNodeList members = typeNode.SelectNodes("*[@id]");
                foreach (XmlElement memberNode in members) {
                    string id = memberNode.Attributes["id"].Value;
                    switch (memberNode.Name) {
                        case "constructor":
                            _elementNames[id] = _elementNames[typeId];
                            break;
                        case "field":
                            _elementNames[id] = memberNode.Attributes["name"].Value;
                            break;
                        case "property":
                            _elementNames[id] = GetElementNameForProperty(memberNode);
                            break;
                        case "method":
                            _elementNames[id] = GetElementNameForMethod(memberNode);
                            break;
                        case "operator":
                            _elementNames[id] = memberNode.Attributes["name"].Value;
                            break;
                        case "event":
                            _elementNames[id] = memberNode.Attributes["name"].Value;
                            break;
                    }
                }
            }
        }
Exemple #2
0
 internal static NAntXsltUtilities CreateInstance(XmlDocument doc, NAntDocumenterConfig config)
 {
     // just in case... but we should never see this happen.
     lock (Instances) {
         foreach (NAntXsltUtilities util in Instances)
         {
             if (util.Document == doc && util.Config.SdkDocVersion.Equals(config.SdkDocVersion) && util.Config.SdkLinksOnWeb == config.SdkLinksOnWeb)
             {
                 return(util);
             }
         }
         NAntXsltUtilities inst = new NAntXsltUtilities(doc, config);
         Instances.Add(inst);
         return(inst);
     }
 }
Exemple #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="NAntXsltUtilities" />
        /// class.
        /// </summary>
        private NAntXsltUtilities(XmlDocument doc, NAntDocumenterConfig config)
        {
            _doc    = doc;
            _config = config;

            if (config.SdkLinksOnWeb)
            {
                _sdkDocBaseUrl = MsdnOnlineSdkBaseUrl;
                _sdkDocExt     = MsdnOnlineSdkPageExt;
            }
            else
            {
                switch (config.SdkDocVersion)
                {
                case SdkVersion.SDK_v1_0:
                    _sdkDocBaseUrl = SdkDoc10BaseUrl;
                    _sdkDocExt     = SdkDocPageExt;
                    break;

                case SdkVersion.SDK_v1_1:
                    _sdkDocBaseUrl = SdkDoc11BaseUrl;
                    _sdkDocExt     = SdkDocPageExt;
                    break;
                }
            }

            // create a list of element names by id
            XmlNodeList types = Document.SelectNodes("//class");

            foreach (XmlElement typeNode in types)
            {
                string typeId = typeNode.Attributes["id"].Value;
                _elementNames[typeId] = GetElementNameForType(typeNode);

                XmlNodeList members = typeNode.SelectNodes("*[@id]");
                foreach (XmlElement memberNode in members)
                {
                    string id = memberNode.Attributes["id"].Value;
                    switch (memberNode.Name)
                    {
                    case "constructor":
                        _elementNames[id] = _elementNames[typeId];
                        break;

                    case "field":
                        _elementNames[id] = memberNode.Attributes["name"].Value;
                        break;

                    case "property":
                        _elementNames[id] = GetElementNameForProperty(memberNode);
                        break;

                    case "method":
                        _elementNames[id] = GetElementNameForMethod(memberNode);
                        break;

                    case "operator":
                        _elementNames[id] = memberNode.Attributes["name"].Value;
                        break;

                    case "event":
                        _elementNames[id] = memberNode.Attributes["name"].Value;
                        break;
                    }
                }
            }
        }
 /// <summary>
 /// Resets the documenter to a clean state.
 /// </summary>
 public override void Clear()
 {
     Config = new NAntDocumenterConfig();
 }
 internal static NAntXsltUtilities CreateInstance(XmlDocument doc, NAntDocumenterConfig config)
 {
     // just in case... but we should never see this happen.
     lock (Instances) {
         foreach (NAntXsltUtilities util in Instances) {
             if (util.Document == doc && util.Config.SdkDocVersion.Equals(config.SdkDocVersion) && util.Config.SdkLinksOnWeb == config.SdkLinksOnWeb) {
                 return util;
             }
         }
         NAntXsltUtilities inst = new NAntXsltUtilities(doc, config);
         Instances.Add(inst);
         return inst;
     }
 }
Exemple #6
0
 /// <summary>
 /// Resets the documenter to a clean state.
 /// </summary>
 public override void Clear()
 {
     Config = new NAntDocumenterConfig();
 }