Exemplo n.º 1
0
 /// <summary>
 /// Creates a new instance of <see cref="MagicedCollection{TMagiced}"/> class.
 /// </summary>
 /// <param name="displayName">The display name of the new instance.</param>
 public MagicedCollection(string displayName)
 {
     DisplayName = displayName;
     _supported  = new HashSet <Type>();
     _references = new HashSet <TMagiced>();
     _links      = new MultiValueDicionary <Type, TMagiced>();
 }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="AssetManager"/> class
        /// with a <see cref="IAssetSource"/>.
        /// </summary>
        /// <param name="assetSource"></param>
        public AssetManager(IAssetSource assetSource)
        {
            if (assetSource == null)
            {
                throw new NullReferenceException(nameof(assetSource));
            }

            _assetSource  = assetSource;
            _loadedAssets = new MultiValueDicionary <string, object>(
                new ConcurrentDictionary <string, ICollection <object> >(StringComparer.OrdinalIgnoreCase),
                () => new ConcurrentList <object>());
            _disposableAssets = new ConcurrentList <IDisposable>();
            _disposed         = false;
        }