コード例 #1
0
            public ConnectionPointCookie([NotNull] IConnectionPoint connectionPoint, uint cookie)
            {
                Debug.Assert(connectionPoint != null);

                _connectionPoint = new Tvl.WeakReference <IConnectionPoint>(connectionPoint);
                _cookie          = cookie;
            }
コード例 #2
0
            public ConnectionPointCookie(IConnectionPoint connectionPoint, uint cookie)
            {
                Contract.Requires(connectionPoint != null);

                _connectionPoint = new WeakReference <IConnectionPoint>(connectionPoint);
                _cookie          = cookie;
            }
コード例 #3
0
 public void Dispose()
 {
     if (_cookie != 0)
     {
         IConnectionPoint connectionPoint = _connectionPoint.Target;
         if (connectionPoint != null)
         {
             connectionPoint.Unadvise(_cookie);
             _cookie = 0;
         }
     }
 }
コード例 #4
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;
        }
コード例 #5
0
 public ConnectionPointCookie(IConnectionPoint connectionPoint, uint cookie)
 {
     _connectionPoint = new WeakReference <IConnectionPoint>(connectionPoint);
     _cookie          = cookie;
 }