Пример #1
0
        public void Contains()
        {
            var td = new TypeList <IServiceCollection> {
                typeof(ServiceCollection)
            };

            td.Contains <ServiceCollection>().ShouldBeTrue();
            td.Contains(typeof(ServiceCollection)).ShouldBeTrue();
            td.Contains <IServiceCollection>().ShouldBeFalse();
            td.Contains(typeof(IServiceCollection)).ShouldBeFalse();
            Should.Throw <ArgumentException>(() => td.Contains(typeof(IServiceProvider)));
        }
Пример #2
0
            public void BlackListType(string _newType)
            {
                if (TypeList.Contains(_newType))
                {
                    return;
                }

                TypeList.Add(_newType);
            }
Пример #3
0
        public void SetView <T>() where T : View
        {
            if (list.Contains <T>())
            {
                current = Get <T>();
            }

            if (previous.Count > 0 && previous.Peek() != current)
            {
                previous.Push(current);
            }

            DrawView(current);
        }