本文整理汇总了C#中System.Web.Services.Description.ServiceDescriptionImporter.AddReference方法的典型用法代码示例。如果您正苦于以下问题:C# ServiceDescriptionImporter.AddReference方法的具体用法?C# ServiceDescriptionImporter.AddReference怎么用?C# ServiceDescriptionImporter.AddReference使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.Services.Description.ServiceDescriptionImporter
的用法示例。
在下文中一共展示了ServiceDescriptionImporter.AddReference方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateWebReferences
[MonoTODO] // where to use Verbose and Extensions in options?
public static StringCollection GenerateWebReferences (
WebReferenceCollection webReferences,
CodeDomProvider codeGenerator,
CodeCompileUnit codeCompileUnit,
WebReferenceOptions options)
{
StringCollection allWarnings = new StringCollection ();
ImportContext context = new ImportContext (new CodeIdentifiers(), true);
foreach (WebReference reference in webReferences)
{
ServiceDescriptionImporter importer = new ServiceDescriptionImporter ();
if (codeGenerator != null)
importer.CodeGenerator = codeGenerator;
importer.CodeGenerationOptions = options.CodeGenerationOptions;
importer.Context = context;
importer.Style = options.Style;
importer.ProtocolName = reference.ProtocolName;
importer.AddReference (reference);
reference.Warnings = importer.Import (reference.ProxyCode, codeCompileUnit);
reference.SetValidationWarnings (context.Warnings);
foreach (string s in context.Warnings)
allWarnings.Add (s);
context.Warnings.Clear ();
}
return allWarnings;
}