Share via


IVsWCFMetadataStorageProvider Interface

Definition

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

public interface class IVsWCFMetadataStorageProvider
public interface class IVsWCFMetadataStorageProvider
__interface IVsWCFMetadataStorageProvider
[System.Runtime.InteropServices.Guid("F71D2B05-680F-423B-B00F-52A2944AC45C")]
[System.Runtime.InteropServices.InterfaceType(1)]
public interface IVsWCFMetadataStorageProvider
[<System.Runtime.InteropServices.Guid("F71D2B05-680F-423B-B00F-52A2944AC45C")>]
[<System.Runtime.InteropServices.InterfaceType(1)>]
type IVsWCFMetadataStorageProvider = interface
Public Interface IVsWCFMetadataStorageProvider
Attributes

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;  
}  

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.

Methods

AdviseWCFMetadataStorageProviderEvents(IVsWCFMetadataStorageProviderEvents, UInt32)

Registers the caller for metadata storage provider event notification.

CreateStorage(String, String, IVsWCFMetadataStorage, StorageNameValidationState)

Creates a new Windows Communication Foundation (WCF) metadata storage.

GetStorageFromMapFile(String)

Returns a Windows Communication Foundation (WCF) metadata storage based on the full path of a .svcmap file.

GetStorages()

Enumerates Windows Communication Foundation (WCF) metadata storages in a project.

IsValidNewReferenceName(String, String, SByte, StorageNameValidationState, String)

Returns a value that determines whether a name for a Windows Communication Foundation (WCF) service reference is unique.

MakeValidReferenceName(String, String, String, String)

Returns a unique name and namespace for a Windows Communication Foundation (WCF) service reference.

UnadviseWCFMetadataStorageProviderEvents(UInt32)

Cancels registration for metadata storage provider event notification.

Applies to