Exemplo n.º 1
0
        /// <summary>
        /// Unsubscribes from the code model events.
        /// </summary>
        /// <param name="subscriber">Subscriber.</param>
        public void UnsubscribeCodeModelEvents(ICodeModelEvents subscriber)
        {
            if (subscriber == null)
            {
                throw new ArgumentNullException(nameof(subscriber));
            }

            if (_codeModelEventSubscribers.Contains(subscriber))
            {
                _codeModelEventSubscribers.Remove(subscriber);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Subscribes to the code model events.
        /// </summary>
        /// <param name="subscriber">Subscriber.</param>
        public void SubscribeCodeModelEvents(ICodeModelEvents subscriber)
        {
            if (subscriber == null)
            {
                throw new ArgumentNullException(nameof(subscriber));
            }

            ThreadHelper.ThrowIfNotOnUIThread();

            if (!_initialized)
            {
                Initialize();
            }

            if (!_codeModelEventSubscribers.Contains(subscriber))
            {
                _codeModelEventSubscribers.Add(subscriber);
            }
        }