共用方式為


IVsWCFReferenceGroupCollection Interface

Provides an interface for managing Windows Communication Foundation (WCF) reference groups.

Namespace:  Microsoft.VisualStudio.WCFReference.Interop
Assembly:  Microsoft.VisualStudio.WCFReference.Interop (in Microsoft.VisualStudio.WCFReference.Interop.dll)

Syntax

'宣告
<GuidAttribute("343173D2-F910-4C03-930D-16AB1568431B")> _
<InterfaceTypeAttribute()> _
Public Interface IVsWCFReferenceGroupCollection _
    Inherits IVsWCFObject
[GuidAttribute("343173D2-F910-4C03-930D-16AB1568431B")]
[InterfaceTypeAttribute()]
public interface IVsWCFReferenceGroupCollection : IVsWCFObject
[GuidAttribute(L"343173D2-F910-4C03-930D-16AB1568431B")]
[InterfaceTypeAttribute()]
public interface class IVsWCFReferenceGroupCollection : IVsWCFObject
[<GuidAttribute("343173D2-F910-4C03-930D-16AB1568431B")>]
[<InterfaceTypeAttribute()>]
type IVsWCFReferenceGroupCollection =  
    interface
        interface IVsWCFObject
    end
public interface IVsWCFReferenceGroupCollection extends IVsWCFObject

The IVsWCFReferenceGroupCollection type exposes the following members.

Methods

  Name Description
Public method Add Adds a Windows Communication Foundation (WCF) reference group to the collection.
Public method ContainingProject Returns the project hierarchy for the project that contains the collection.
Public method Count Returns a count of Windows Communication Foundation (WCF) reference groups in the collection.
Public method GetReferenceGroupByName Returns a specified Windows Communication Foundation (WCF) reference group in the collection.
Public method GetReferenceGroupFromMapFile Returns a specified Windows Communication Foundation (WCF) reference group in the collection.
Public method IsValid() Determines whether a Windows Communication Foundation (WCF) service reference object has been invalidated. (Inherited from IVsWCFObject.)
Public method IsValid() Determines if the index for a Windows Communication Foundation (WCF) reference group is valid in the collection.
Public method Item Returns a specified Windows Communication Foundation (WCF) reference group in the collection.
Public method Reload() Reloads a Windows Communication Foundation (WCF) service reference object. (Inherited from IVsWCFObject.)
Public method Reload() Refreshes a Windows Communication Foundation (WCF) reference group collection.
Public method Remove Removes a Windows Communication Foundation (WCF) reference group from the collection.
Public method RemoveAt Removes a Windows Communication Foundation (WCF) reference group from the collection by index.
Public method UpdateAll Updates all Windows Communication Foundation (WCF) reference group in the collection.

Top

Remarks

A WCF reference group is the basic unit for code generation. A project or solution can contain multiple reference groups.

Examples

The following example demonstrates how to use the IVsWCFReferenceGroupCollection interface to enumerate WCF reference groups.

/// Enumerates reference groups and returns the tree node representing /// the reference groups.
private TreeNode EnumerateReferenceGroups(IVsWCFReferenceManager
 referenceManager)
{
    IVsWCFReferenceGroupCollection referenceGroups =
 referenceManager.GetReferenceGroupCollection();
    TreeNode groupsNode = CreateExplorerTreeNode(Resources.EnumRefGrp,
                                        ExplorerNodeType.Group,
                                        referenceManager,
                                        ExplorerNodeType.Reference);

    for (int i = 0; i < referenceGroups.Count(); ++i)
    {
        try
        {
            IVsWCFReferenceGroup group = referenceGroups.Item(i);
            groupsNode.Nodes.Add(CreateReferenceGroupNode(group));
        }
        catch (Exception ex)
        {
            groupsNode.Nodes.Add(CreateErrorNode(ex));
         }
     }

    return groupsNode;
}

See Also

Reference

Microsoft.VisualStudio.WCFReference.Interop Namespace

IVsWCFReferenceGroup