예제 #1
0
        public bool TryAddMember(DefintionLifetime defintionLifetime, IKey key, IBox <IIsPossibly <WeakMemberDefinition> > definition)
        {
            if (finalizableScope.IsFinal)
            {
                throw new ApplicationException("bug: don't add after finalize");
            }
            var list = members.GetOrAdd(key, new ConcurrentSet <Tuple <DefintionLifetime, IBox <IIsPossibly <WeakMemberDefinition> > > >());

            return(list.TryAdd(new Tuple <DefintionLifetime, IBox <IIsPossibly <WeakMemberDefinition> > >(defintionLifetime, definition)));
        }
예제 #2
0
 public Visiblity(DefintionLifetime defintionLifeTime, TReferanced definition)
 {
     DefintionLifeTime = defintionLifeTime;
     Definition        = definition ?? throw new ArgumentNullException(nameof(definition));
 }