IEnumWCFReferenceContracts Interface
Visual Studio 2015
An enumerator for Windows Communication Foundation (WCF) service contracts.
Assembly: Microsoft.VisualStudio.WCFReference.Interop (in Microsoft.VisualStudio.WCFReference.Interop.dll)
| Name | Description | |
|---|---|---|
![]() | Clone(IEnumWCFReferenceContracts) | Clones this IEnumWCFReferenceContracts interface by creating another instance. |
![]() | GetEnumerator() | (Inherited from IEnumerable.) |
![]() | Next(UInt32, IVsWCFReferenceContract[], UInt32) | Retrieves the next IVsWCFReferenceContract. |
![]() | Reset() | Returns the enumerator to its initial state. |
![]() | Skip(UInt32) | Skips a specified number of IVsWCFReferenceContract interfaces. |
You can get an instance of the interface by using the GetContractsEnumerator method of the IVsWCFReferenceGroup interface.
The following example demonstrates how to populate a TreeNode with contracts by using the IEnumWCFReferenceContracts enumerator.
/// 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;
}
Show:
