/// <include file='doc\ProtocolImporter.uex' path='docs/doc[@for="ProtocolImporter.AddExtensionWarningComments"]/*' /> /// <devdoc> /// <para>[To be supplied.]</para> /// </devdoc> public void AddExtensionWarningComments(CodeCommentStatementCollection comments, ServiceDescriptionFormatExtensionCollection extensions) { foreach (object item in extensions) { if (!extensions.IsHandled(item)) { string name = null; string ns = null; if (item is XmlElement) { XmlElement element = (XmlElement)item; name = element.LocalName; ns = element.NamespaceURI; } else if (item is ServiceDescriptionFormatExtension) { XmlFormatExtensionAttribute[] attrs = (XmlFormatExtensionAttribute[])item.GetType().GetCustomAttributes(typeof(XmlFormatExtensionAttribute), false); if (attrs.Length > 0) { name = attrs[0].ElementName; ns = attrs[0].Namespace; } } if (name != null) { if (extensions.IsRequired(item)) { warnings |= ServiceDescriptionImportWarnings.RequiredExtensionsIgnored; AddWarningComment(comments, Res.GetString(Res.WebServiceDescriptionIgnoredRequired, name, ns)); } else { warnings |= ServiceDescriptionImportWarnings.OptionalExtensionsIgnored; AddWarningComment(comments, Res.GetString(Res.WebServiceDescriptionIgnoredOptional, name, ns)); } } } } }
public void AddExtensionWarningComments(CodeCommentStatementCollection comments, ServiceDescriptionFormatExtensionCollection extensions) { foreach (object obj2 in extensions) { if (!extensions.IsHandled(obj2)) { string localName = null; string namespaceURI = null; if (obj2 is XmlElement) { XmlElement element = (XmlElement)obj2; localName = element.LocalName; namespaceURI = element.NamespaceURI; } else if (obj2 is ServiceDescriptionFormatExtension) { XmlFormatExtensionAttribute[] customAttributes = (XmlFormatExtensionAttribute[])obj2.GetType().GetCustomAttributes(typeof(XmlFormatExtensionAttribute), false); if (customAttributes.Length > 0) { localName = customAttributes[0].ElementName; namespaceURI = customAttributes[0].Namespace; } } if (localName != null) { if (extensions.IsRequired(obj2)) { this.warnings |= ServiceDescriptionImportWarnings.RequiredExtensionsIgnored; AddWarningComment(comments, System.Web.Services.Res.GetString("WebServiceDescriptionIgnoredRequired", new object[] { localName, namespaceURI })); } else { this.warnings |= ServiceDescriptionImportWarnings.OptionalExtensionsIgnored; AddWarningComment(comments, System.Web.Services.Res.GetString("WebServiceDescriptionIgnoredOptional", new object[] { localName, namespaceURI })); } } } } }
public void AddExtensionWarningComments(CodeCommentStatementCollection comments, ServiceDescriptionFormatExtensionCollection extensions) { foreach (object obj2 in extensions) { if (!extensions.IsHandled(obj2)) { string localName = null; string namespaceURI = null; if (obj2 is XmlElement) { XmlElement element = (XmlElement) obj2; localName = element.LocalName; namespaceURI = element.NamespaceURI; } else if (obj2 is ServiceDescriptionFormatExtension) { XmlFormatExtensionAttribute[] customAttributes = (XmlFormatExtensionAttribute[]) obj2.GetType().GetCustomAttributes(typeof(XmlFormatExtensionAttribute), false); if (customAttributes.Length > 0) { localName = customAttributes[0].ElementName; namespaceURI = customAttributes[0].Namespace; } } if (localName != null) { if (extensions.IsRequired(obj2)) { this.warnings |= ServiceDescriptionImportWarnings.RequiredExtensionsIgnored; AddWarningComment(comments, System.Web.Services.Res.GetString("WebServiceDescriptionIgnoredRequired", new object[] { localName, namespaceURI })); } else { this.warnings |= ServiceDescriptionImportWarnings.OptionalExtensionsIgnored; AddWarningComment(comments, System.Web.Services.Res.GetString("WebServiceDescriptionIgnoredOptional", new object[] { localName, namespaceURI })); } } } } }