Condividi tramite


IVsAddWebReferenceResult Interface

Contains data gathered by the Add Service Reference dialog box.

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

Syntax

'Dichiarazione
<GuidAttribute("4B85C5EF-9089-4E4C-A310-325BF87BAF23")> _
<InterfaceTypeAttribute()> _
Public Interface IVsAddWebReferenceResult
[GuidAttribute("4B85C5EF-9089-4E4C-A310-325BF87BAF23")]
[InterfaceTypeAttribute()]
public interface IVsAddWebReferenceResult
[GuidAttribute(L"4B85C5EF-9089-4E4C-A310-325BF87BAF23")]
[InterfaceTypeAttribute()]
public interface class IVsAddWebReferenceResult
[<GuidAttribute("4B85C5EF-9089-4E4C-A310-325BF87BAF23")>]
[<InterfaceTypeAttribute()>]
type IVsAddWebReferenceResult =  interface end
public interface IVsAddWebReferenceResult

The IVsAddWebReferenceResult type exposes the following members.

Methods

  Name Description
Public method GetDetail Returns an interface that exposes additional properties of a service reference in the Add Service Reference dialog box.
Public method GetReferenceName Returns the name of a service reference in the Add Service Reference dialog box.
Public method GetReferenceNamespace Returns the namespace of a service reference in the Add Service Reference dialog box.
Public method GetReferenceType Returns the ServiceReferenceType of a service reference in the Add Service Reference dialog box.
Public method GetReferenceUrl Returns the URL for a service reference in the Add Service Reference dialog box.
Public method Save Saves reference metadata in the project and creates a new Windows Communication Foundation (WCF) service reference.

Top

Remarks

The IVsAddWebReferenceResult interface represents the data gathered by the Add Service Reference dialog box.

Examples

The following example demonstrates how to return the results of the Add Service Reference dialog box by using the IVsAddWebReferenceResult interface.

/// Add a service reference to the given project. 
private static IVsWCFReferenceGroup TryAddServiceReference
 (IVsHierarchy hierarchy, IServiceProvider serviceProvider,
 IDiscoverySession discoverySession)
{
    Debug.Assert(serviceProvider != null, "Why are we passing in a NULL
 service provider to a private method?");

    IVsAddWebReferenceDlg3 awrdlg = 
 serviceProvider.GetService(typeof(SVsAddWebReferenceDlg3))
 as IVsAddWebReferenceDlg3;
    IVsAddWebReferenceResult addWebReferenceResult = null;
    int cancelled = 1;

    if (awrdlg != null && hierarchy != null)
    {
        awrdlg.ShowAddWebReferenceDialog(
            hierarchy,
            discoverySession,
            ServiceReferenceType.SRT_WCFReference,
            null,
            null,
            null,
            out addWebReferenceResult,
            out cancelled);
    }

    if (addWebReferenceResult != null && cancelled == 0)
    {
        return addWebReferenceResult.Save() as IVsWCFReferenceGroup;
    }
    else
    {
         return null;
    }
}

See Also

Reference

Microsoft.VisualStudio.WCFReference.Interop Namespace