This topic has not yet been rated - Rate this topic

IVsWCFReferenceEvents Interface

Raises events for Windows Communication Foundation (WCF) service references.

Namespace:  Microsoft.VisualStudio.WCFReference.Interop
Assembly:  Microsoft.VisualStudio.WCFReference.Interop (in Microsoft.VisualStudio.WCFReference.Interop.dll)
[GuidAttribute("729D5091-E77F-4D0B-B03A-2310AD58DDC2")]
[InterfaceTypeAttribute()]
public interface IVsWCFReferenceEvents

The IVsWCFReferenceEvents type exposes the following members.

  NameDescription
Public methodOnConfigurationChangedRaises the ConfigurationChanged event.
Public methodOnMetadataChangedRaises the MetaDataChanged event.
Public methodOnMetadataChangingRaises the MetaDataChanged event.
Public methodOnReferenceGroupCollectionChangedRaises an event after a new reference is added or an existing reference is deleted.
Public methodOnReferenceGroupCollectionChangingRaises an event after a new reference is added or an existing reference is deleted.
Public methodOnReferenceGroupPropertiesChangedRaises an event after reference group properties (including name, namespace, proxy generation options and URL) for a particular reference group are changed.
Public methodOnReferenceGroupPropertiesChangingRaises an event before reference group properties (including name, namespace, proxy generation options and URL) for a particular reference group are changed.
Top

The following example demonstrates a class that handles WCF service reference events.

/// Listens to referenceGroup events and notifies the controller of the events.
class ReferenceEventsListener : WCF.IVsWCFReferenceEvents, IDisposable
{
    private IExplorerController controller;
    private WCF.IVsWCFReferenceManager referenceManager;
    private uint cookie;
    private bool hasCookie = false;

    public ReferenceEventsListener(IExplorerController controller,
  WCF.IVsWCFReferenceManager referenceManager)
    {
        this.controller = controller;
        this.referenceManager = referenceManager;
        referenceManager.AdviseWCFReferenceEvents(this, out cookie);
            Debug.Assert(cookie != 0);
            hasCookie = true;
        }
    void WCF.IVsWCFReferenceEvents.OnMetadataChanged
 (WCF.IVsWCFReferenceGroup pReferenceGroup)
    {
        controller.Log(String.Format(CultureInfo.InvariantCulture,
 Resources.LogEventFired, "IVsWCFReferenceEvents.OnMetadataChanged",
 pReferenceGroup.GetName()));
        controller.Update();
    }
    void WCF.IVsWCFReferenceEvents.OnMetadataChanging
 (WCF.IVsWCFReferenceGroup pReferenceGroup)
    {
        controller.Log(String.Format(CultureInfo.InvariantCulture,
 Resources.LogEventFired, "IVsWCFReferenceEvents.OnMetadataChanging",
 pReferenceGroup.GetName()));
    }
    void WCF.IVsWCFReferenceEvents.OnReferenceGroupPropertiesChanged
 (WCF.IVsWCFReferenceGroup pReferenceGroup)
    {
        controller.Log(String.Format(CultureInfo.InvariantCulture,
 Resources.LogEventFired,
 "IVsWCFReferenceEvents.OnReferenceGroupPropertiesChanged",
 pReferenceGroup.GetName()));
        controller.Update();
    }
    void WCF.IVsWCFReferenceEvents.OnReferenceGroupPropertiesChanging
 (WCF.IVsWCFReferenceGroup pReferenceGroup)
    {
        controller.Log(String.Format(CultureInfo.InvariantCulture,
 Resources.LogEventFired,\"IVsWCFReferenceEvents.
 ReferenceGroupPropertiesChanging", pReferenceGroup.GetName())); 
    }
        void WCF.IVsWCFReferenceEvents.OnConfigurationChanged()
    {
        controller.Log(String.Format(CultureInfo.InvariantCulture,
 Resources.LogEventFiredGeneric,
 "IVsWCFReferenceEvents.OnConfigurationChanged"));
        controller.Update();
    }
    void WCF.IVsWCFReferenceEvents.OnReferenceGroupCollectionChanged()
    {
        controller.Log(String.Format(CultureInfo.InvariantCulture,
 Resources.LogEventFiredGeneric,
 "IVsWCFReferenceEvents.OnReferenceGroupCollectionChanged"));
        controller.Update();
    }
    void WCF.IVsWCFReferenceEvents.OnReferenceGroupCollectionChanging()
    {
        controller.Log(String.Format(CultureInfo.InvariantCulture,
 Resources.LogEventFiredGeneric,
 "IVsWCFReferenceEvents.OnReferenceGroupCollectionChanging"));
    }
}
Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.