示例#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);
        }