IEnumWCFReferenceContracts Interface
An enumerator for Windows Communication Foundation (WCF) service contracts.
Namespace: Microsoft.VisualStudio.WCFReference.Interop
Assembly: Microsoft.VisualStudio.WCFReference.Interop (in Microsoft.VisualStudio.WCFReference.Interop.dll)
Syntax
'Declaration
<GuidAttribute("A8F120C5-E7DF-465A-A7FB-711805281A3B")> _
Public Interface IEnumWCFReferenceContracts _
Inherits IEnumerable
'Usage
Dim instance As IEnumWCFReferenceContracts
[GuidAttribute("A8F120C5-E7DF-465A-A7FB-711805281A3B")]
public interface IEnumWCFReferenceContracts : IEnumerable
[GuidAttribute(L"A8F120C5-E7DF-465A-A7FB-711805281A3B")]
public interface class IEnumWCFReferenceContracts : IEnumerable
public interface IEnumWCFReferenceContracts extends IEnumerable
Remarks
You can get an instance of the interface by using the GetContractsEnumerator method of the IVsWCFReferenceGroup interface.
Examples
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;
}