IVsWCFMetadataStorageProvider Interface

Provides an interface for saving Windows Communication Foundation (WCF) service metadata in the project system.

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

Syntax

'Declaration
<GuidAttribute("F71D2B05-680F-423B-B00F-52A2944AC45C")> _
<InterfaceTypeAttribute()> _
Public Interface IVsWCFMetadataStorageProvider
'Usage
Dim instance As IVsWCFMetadataStorageProvider
[GuidAttribute("F71D2B05-680F-423B-B00F-52A2944AC45C")]
[InterfaceTypeAttribute()]
public interface IVsWCFMetadataStorageProvider
[GuidAttribute(L"F71D2B05-680F-423B-B00F-52A2944AC45C")]
[InterfaceTypeAttribute()]
public interface class IVsWCFMetadataStorageProvider
public interface IVsWCFMetadataStorageProvider

Remarks

Project systems must implement this interface. Call this interface to create a new storage to save a service reference group, or emulate existing storages in the project.

The project system must determine the correct directory structure to store its metadata.

Examples

The following example uses the IVsWCFMetadataStorageProvider interface to determine whether a project supports WCF service references.

/// Helper method to determine if WCF ServiceReferences are
/// supported by the given hierarchy.
private static bool
 ServiceReferencesSupported(IVsWCFReferenceManagerFactory factory,
 IVsHierarchy hierarchy)
{
    if (hierarchy != null)
    {

        // Try to see if Reference Manager Factory supports it. 
        if
 (!Convert.ToBoolean(factory.IsReferenceManagerSupported(hierarchy)))
        {
            return false;
        }
        /// If factory supports, then ask Hierarchy. They both need to 
        /// support it.
        if ((hierarchy as IVsWCFMetadataStorageProvider) != null)
        {
            try
            {
                object objIsServiceReferenceSupported;
                ErrorHandler.ThrowOnFailure(hierarchy.GetProperty
 (Microsoft.VisualStudio.VSConstants.VSITEMID_ROOT,
 (int)__VSHPROPID3.VSHPROPID_ServiceReferenceSupported,
 out objIsServiceReferenceSupported));
                if (objIsServiceReferenceSupported != null &&
 objIsServiceReferenceSupported is bool)
                {
                    return (bool)objIsServiceReferenceSupported;
                }
            }
            catch (NotImplementedException)
            {
                // If the property isn't implemented in the current 
                // project system, then we know that
                // service references aren't supported.
            }
        }
    }
    return false;
}

See Also

Reference

IVsWCFMetadataStorageProvider Members

Microsoft.VisualStudio.WCFReference.Interop Namespace