public ConnectionPointCookie([NotNull] IConnectionPoint connectionPoint, uint cookie) { Debug.Assert(connectionPoint != null); _connectionPoint = new Tvl.WeakReference <IConnectionPoint>(connectionPoint); _cookie = cookie; }
public ConnectionPointCookie(IConnectionPoint connectionPoint, uint cookie) { Contract.Requires(connectionPoint != null); _connectionPoint = new WeakReference <IConnectionPoint>(connectionPoint); _cookie = cookie; }
public void Dispose() { if (_cookie != 0) { IConnectionPoint connectionPoint = _connectionPoint.Target; if (connectionPoint != null) { connectionPoint.Unadvise(_cookie); _cookie = 0; } } }
public virtual int Next(uint cConnections, IConnectionPoint[] ppCP, out uint pcFetched) { pcFetched = 0; if (ppCP == null || ppCP.Length < cConnections) return VSConstants.E_INVALIDARG; int remaining = _connectionPoints.Count - _currentIndex; pcFetched = checked((uint)Math.Min(cConnections, remaining)); for (int i = 0; i < pcFetched; i++) ppCP[i] = _connectionPoints[_currentIndex + i]; _currentIndex += (int)pcFetched; return pcFetched == cConnections ? VSConstants.S_OK : VSConstants.S_FALSE; }
public ConnectionPointCookie(IConnectionPoint connectionPoint, uint cookie) { _connectionPoint = new WeakReference <IConnectionPoint>(connectionPoint); _cookie = cookie; }