/// <summary> /// Notifies all of our event listeners that an item in the hierarchy has changed. /// </summary> /// <param name="node">The <see cref="Node"/> that has changed.</param> /// <param name="propertyId">The property that has changed.</param> public void OnPropertyChanged(Node node, __VSHPROPID propertyId) { Tracer.VerifyNonNullArgument(node, "node"); object newValue; node.GetProperty(propertyId, out newValue); // There are some cases where the collection is changed while we're iterating it. // To be safe, we'll create a copy of the collection and iterate over that. // We just want a shallow copy, though, and not a deep (Clone) copy. ArrayList clone = new ArrayList(this.Values); for (int i = 0; i < clone.Count; i++) { IVsHierarchyEvents eventItem = (IVsHierarchyEvents)clone[i]; Tracer.WriteLineVerbose(classType, "OnPropertyChanged", "Notifying event listener {0} that '{1}' has changed its {2} property to '{3}'.", this.CookieOf(i), node.Caption, propertyId, newValue); try { eventItem.OnPropertyChanged(node.HierarchyId, (int)propertyId, 0); } catch (Exception e) { Tracer.WriteLineWarning(classType, "OnPropertyChanged", "There was an exception in the event listener {0} event handling code: {1}", this.CookieOf(i), e.ToString()); } } }
int IVsSolutionEvents.OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded) { _vsHierarchyEvents = new VsHierarchyEvents(pHierarchy, _xrmToolingConnection); pHierarchy.AdviseHierarchyEvents(_vsHierarchyEvents, out _cookie); return(VSConstants.S_OK); }
int IVsSolutionEvents.OnBeforeCloseProject(IVsHierarchy pHierarchy, int fRemoved) { _vsHierarchyEvents = new VsHierarchyEvents(pHierarchy, _xrmToolingConnection); pHierarchy.UnadviseHierarchyEvents(_cookie); return(VSConstants.S_OK); }
public int OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded) { m_myVsHierarchyEvents = new MyVsHierarchyEvents(); pHierarchy.AdviseHierarchyEvents(m_myVsHierarchyEvents, out m_cookie); // do other things here ... return(VSConstants.S_OK); }
public void AdviseHierarchyEvents(IVsHierarchyEvents hierarchyEvents) { ThreadHelper.ThrowIfNotOnUIThread(); if (_eventCookie != 0) { Logger.Error($"{nameof(AdviseHierarchyEvents)}: event cookie not 0 ({_eventCookie})"); } _eventCookie = Hierarchy?.AdviseHierarchyEvents(hierarchyEvents) ?? 0; }
public override int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { var hr = base.AdviseHierarchyEvents(pEventSink, out pdwCookie); if (hr == VSConstants.S_OK) { _hierEventSinks.Add(pdwCookie, pEventSink); } return(hr); }
public virtual int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { return(InnerHierarchy.AdviseHierarchyEvents(pEventSink, out pdwCookie)); }
//========================================================================================== // IVsHierarchy Members //========================================================================================== int IVsHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { return ((IVsUIHierarchy)this).AdviseHierarchyEvents(pEventSink, out pdwCookie); }
int IVsHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { return(_data.AdviseHierarchyEvents(pEventSink, out pdwCookie)); }
/// <summary> /// Override event hierarchy notifications. /// </summary> protected override sealed uint AdviseHierarchyEvents(IVsHierarchyEvents listener) { return hierarchyListeners.AdviseHierarchyEvents(listener); }
public int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = _eventSinks.Add(pEventSink); return 0; }
public virtual int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = _eventCounter; _events[_eventCounter++] = pEventSink; return VSConstants.S_OK; }
/// <include file='doc\Hierarchy.uex' path='docs/doc[@for="HierarchyNode.AdviseHierarchyEvents"]/*' /> public virtual int AdviseHierarchyEvents(IVsHierarchyEvents sink, out uint cookie){ cookie = this.hierarchyEventSinks.Add(sink); return 0; }
/// <summary> /// Override event hierarchy notifications. /// </summary> protected sealed override uint AdviseHierarchyEvents(IVsHierarchyEvents listener) { return(hierarchyListeners.AdviseHierarchyEvents(listener)); }
int IVsUIHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { return(((IVsHierarchy)this).AdviseHierarchyEvents(pEventSink, out pdwCookie)); }
int IVsUIHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = 100; while (_events.ContainsKey(pdwCookie)) pdwCookie++; _events[pdwCookie] = pEventSink; return VSConstants.S_OK; }
public virtual void AdviseHierarchyEvents(IVsHierarchyEvents sink, out uint cookie) { CCITracing.TraceCall(); cookie = this.hierarchyEventSinks.Add(sink); }
public int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { return(_hierarchy.AdviseHierarchyEvents(pEventSink, out pdwCookie)); }
/// <summary> /// Override event hierarchy notifications. /// </summary> internal uint AdviseHierarchyEvents(IVsHierarchyEvents eventSink) { return(eventSinkCollection.Add(eventSink) + 1); }
int IVsHierarchy.AdviseHierarchyEvents( IVsHierarchyEvents pEventSink, out uint pdwCookie ) { return m_innerIVsHierarchy.AdviseHierarchyEvents( pEventSink, out pdwCookie ); }
int IVsHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = (uint)Interlocked.Increment(ref this.sinkCookies); this.sinks[pdwCookie] = pEventSink; return(VSConstants.S_OK); }
public int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, [ComAliasName("Microsoft.VisualStudio.Shell.Interop.VSCOOKIE")]out uint pdwCookie) { // We never change. pdwCookie = 42; return VSConstants.E_NOTIMPL; }
int IVsSolutionEvents.OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded) { _vsHierarchyEvents = new VsHierarchyEvents(pHierarchy, _webResouceList); pHierarchy.AdviseHierarchyEvents(_vsHierarchyEvents, out _cookie); return(VSConstants.S_OK); }
int IVsHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { throw new Exception("The method or operation is not implemented."); }
int IVsHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { throw new System.NotImplementedException(); }
//========================================================================================== // Methods //========================================================================================== public uint Add(IVsHierarchyEvents listener) { return(base.Add(listener)); }
public virtual int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = _eventCounter; _events[_eventCounter++] = pEventSink; return(VSConstants.S_OK); }
int IVsSolutionEvents.OnAfterOpenProject(IVsHierarchy pHierarchy, int fAdded) { _vsHierarchyEvents = new VsHierarchyEvents(pHierarchy, _reportList); pHierarchy.AdviseHierarchyEvents(_vsHierarchyEvents, out _cookie); return VSConstants.S_OK; }
public abstract void AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie);
public int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { throw new NotImplementedException(); }
public int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = 0; return(VSConstants.E_NOTIMPL); }
public int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, [ComAliasName("Microsoft.VisualStudio.Shell.Interop.VSCOOKIE")] out uint pdwCookie) { // We never change. pdwCookie = 42; return(VSConstants.E_NOTIMPL); }
int IVsHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = (uint)Interlocked.Increment(ref this.sinkCookies); this.sinks[pdwCookie] = pEventSink; return VSConstants.S_OK; }
internal abstract int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie);
/// <include file='doc\Hierarchy.uex' path='docs/doc[@for="HierarchyNode.AdviseHierarchyEvents"]/*' /> public virtual int AdviseHierarchyEvents(IVsHierarchyEvents sink, out uint cookie) { cookie = this.hierarchyEventSinks.Add(sink)+1; return NativeMethods.S_OK; }
/// <summary> /// Override event hierarchy notifications. /// </summary> internal uint AdviseHierarchyEvents(IVsHierarchyEvents eventSink) { return eventSinkCollection.Add(eventSink) + 1; }
//========================================================================================== // Methods //========================================================================================== public uint Add(IVsHierarchyEvents listener) { return base.Add(listener); }
public int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { throw new Exception("The method or operation is not implemented."); }
public int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = _eventSinks.Add(pEventSink); return(0); }
//========================================================================================== // IVsUIHierarchy Members //========================================================================================== int IVsUIHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = this.eventListeners.Add(pEventSink); return NativeMethods.S_OK; }
int IVsHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents eventSink, out uint cookie) { throw new NotImplementedException(); }
public int AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = 0; return VSConstants.E_NOTIMPL; }
/// <inheritdoc/> int IVsHierarchy.AdviseHierarchyEvents(IVsHierarchyEvents pEventSink, out uint pdwCookie) { pdwCookie = ++lastEventSinkCookie; this.cookieSinkMap[pdwCookie] = pEventSink; return(VSConstants.S_OK); }