IVsWCFReferenceEndpoint 接口

表示配置文件的终结点定义。

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

语法

声明
<InterfaceTypeAttribute()> _
<GuidAttribute("EFD57B55-A7DA-4C65-A6DF-90B3B656D749")> _
Public Interface IVsWCFReferenceEndpoint
[InterfaceTypeAttribute()]
[GuidAttribute("EFD57B55-A7DA-4C65-A6DF-90B3B656D749")]
public interface IVsWCFReferenceEndpoint
[InterfaceTypeAttribute()]
[GuidAttribute(L"EFD57B55-A7DA-4C65-A6DF-90B3B656D749")]
public interface class IVsWCFReferenceEndpoint
[<InterfaceTypeAttribute()>]
[<GuidAttribute("EFD57B55-A7DA-4C65-A6DF-90B3B656D749")>]
type IVsWCFReferenceEndpoint =  interface end
public interface IVsWCFReferenceEndpoint

IVsWCFReferenceEndpoint 类型公开以下成员。

方法

  名称 说明
公共方法 GetAddress 返回 EndpointAddress 从配置文件。
公共方法 GetBehaviorConfiguration 返回终结点 BehaviorConfiguration 从配置文件。
公共方法 GetBinding 返回终结点 Binding 从配置文件。
公共方法 GetBindingConfiguration 返回终结点 BindingConfiguration 从配置文件。
公共方法 GetContract 返回终结点 Contract 从配置文件。
公共方法 GetName 返回终结点 Name 从配置文件。

页首

备注

每 IVsWCFReferenceEndpoint 表示配置文件的终结点定义。 所有属性是只读的;,在终结点枚举数创建时,对象是配置数据快照的。 使用者必须使用 System.Configuration 和 WCF 服务模型 API 更新或移除终结点,并且必须重复终结点枚举,如果终结点配置更改。

示例

下面的示例演示如何添加终结点数据。 DataGridView 控件。

/// Populates the values to a grid with the initial values of all of
/// the endpoints selected.
private void PopulateGrid(IVsWCFReferenceGroup referenceGroup)
{
    if (referenceGroup == null)
    {
        throw new ArgumentNullException("referenceGroup");
    }

    IEnumWCFReferenceContracts contractsEnum = 
 referenceGroup.GetContractsEnumerator();

    foreach (IVsWCFReferenceContract contract in contractsEnum)
    {
        string contractName = contract.GetPortTypeName();
        string contractNamespace = contract.GetTargetNamespace();

        IEnumWCFReferenceEndpoints endpointsEnum =
 contract.GetReferenceEndpointEnumerator();
        foreach (IVsWCFReferenceEndpoint endpoint in endpointsEnum)
        {
            endpointsDataGridView.Rows.Add(true, endpoint.GetName(),
 contractNamespace, contractName);
        }
            }
}

请参阅

参考

Microsoft.VisualStudio.WCFReference.Interop 命名空间