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)

[GuidAttribute("A8F120C5-E7DF-465A-A7FB-711805281A3B")]
public interface IEnumWCFReferenceContracts : IEnumerable

NameDescription
System_CAPS_pubmethodClone(IEnumWCFReferenceContracts)

Clones this IEnumWCFReferenceContracts interface by creating another instance.

System_CAPS_pubmethodGetEnumerator()

(Inherited from IEnumerable.)

System_CAPS_pubmethodNext(UInt32, IVsWCFReferenceContract[], UInt32)

Retrieves the next IVsWCFReferenceContract.

System_CAPS_pubmethodReset()

Returns the enumerator to its initial state.

System_CAPS_pubmethodSkip(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;
}
Return to top
Show: