IEnumWCFReferenceContracts 接口

windows communication foundation (WCF) 服务协定的枚举数。

命名空间:  Microsoft.VisualStudio.WCFReference.Interop
程序集:  Microsoft.VisualStudio.WCFReference.Interop(在 Microsoft.VisualStudio.WCFReference.Interop.dll 中)

语法

声明
<GuidAttribute("A8F120C5-E7DF-465A-A7FB-711805281A3B")> _
Public Interface IEnumWCFReferenceContracts _
    Inherits IEnumerable
[GuidAttribute("A8F120C5-E7DF-465A-A7FB-711805281A3B")]
public interface IEnumWCFReferenceContracts : IEnumerable
[GuidAttribute(L"A8F120C5-E7DF-465A-A7FB-711805281A3B")]
public interface class IEnumWCFReferenceContracts : IEnumerable
[<GuidAttribute("A8F120C5-E7DF-465A-A7FB-711805281A3B")>]
type IEnumWCFReferenceContracts =  
    interface 
        interface IEnumerable 
    end
public interface IEnumWCFReferenceContracts extends IEnumerable

IEnumWCFReferenceContracts 类型公开以下成员。

方法

  名称 说明
公共方法 Clone 通过创建另一个实例克隆此 IEnumWCFReferenceContracts 接口。
公共方法 GetEnumerator 返回循环访问集合的枚举数。 (继承自 IEnumerable。)
公共方法 Next 检索下 IVsWCFReferenceContract
公共方法 Reset 返回枚举数到其原始状态。
公共方法 Skip 跳过 IVsWCFReferenceContract 接口指定数目的。

页首

备注

使用 IVsWCFReferenceGroup 接口的 GetContractsEnumerator 方法,您可以获取接口的实例。

示例

使用 IEnumWCFReferenceContracts 枚举数,下面的示例演示如何填充协定的 TreeNode

/// Enumerates and creates a top level contract node.
private TreeNode EnumerateContracts(IVsWCFReferenceGroup group, bool 
 createDummy)
{
    TreeNode contractsNode = CreateExplorerTreeNode(Resources.EnumContracts,
                                    ExplorerNodeType.Group,
                                    group,
                                    ExplorerNodeType.Contract);
    if (createDummy)
    {
        contractsNode.Nodes.Add("Dummy Node, never to be shown");
        return contractsNode;
    }
    // Enumerate the nodes.
    try
    {
        IEnumWCFReferenceContracts contracts = group.GetContractsEnumerator();
        foreach (IVsWCFReferenceContract contract in contracts)
        {
            contractsNode.Nodes.Add(CreateContractNode(contract));
        }
    }
    catch (Exception ex)
    {
        contractsNode.Nodes.Add(CreateErrorNode(ex));
    }

    return contractsNode;
}

请参阅

参考

Microsoft.VisualStudio.WCFReference.Interop 命名空间