ITargetCollection.cs 785 Bytes
Newer Older
1 2 3 4 5 6 7 8
/*
 * Copyright (c) 2017 Ben Lambell.
 * 
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 */

9

10 11
namespace Recurse.Common.Messaging
{
Ben Lambell's avatar
Ben Lambell committed
12
    public interface ITargetCollection<in TReceiver>
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
    {
        /// <summary>
        /// Adds a weak reference to the given receiver.
        /// </summary>
        void Add(TReceiver receiver);

        /// <summary>
        /// Adds a strong reference to the given receiver.
        /// </summary>
        void AddWeak(TReceiver receiver);

        /// <summary>
        /// Removes a reference to the given receiver.
        /// </summary>
        void Remove(TReceiver receiver);
    }
}