/// <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; } } } }
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); } }
/// <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; } }