コード例 #1
0
ファイル: TestACA.cs プロジェクト: ScottWeinstein/ILUnMerge
        public void TestContains()
        {
            TypeReference tref = dcd.TypeList.Find(
                 delegate(TypeDefinition decl) { return (decl.Name == "NestedClass2Deep"); });
            List<UsedClass> list = new List<UsedClass>();
            UsedClass uc1 = new UsedClass(tref, ClassUse.Calls);
            UsedClass uc2 = new UsedClass(tref, ClassUse.Calls);

            list.Add(uc1);
            Assert.IsTrue(list.Contains(uc1));
            Assert.IsTrue(list.Contains(uc2));
        }
コード例 #2
0
        public override bool Equals(object obj)
        {
            UsedClass operand = obj as UsedClass;

            if (operand == null)
            {
                return(false);
            }
            if (operand.Type == Type && operand.Use == Use)
            {
                return(true);
            }
            return(false);
        }
コード例 #3
0
        private void AddTypeToList(TypeReference tref, ClassUse use, List <UsedClass> usedT, bool getAdditionTypeInfo)
        {
            if (tref != null)
            {
                UsedClass uc = new UsedClass(tref, use);

                if (!SkipType(tref) && !usedT.Contains(uc))
                {
                    usedT.Add(uc);
                }
                if (getAdditionTypeInfo)
                {
                    AddUsedTypesFromAttributes(tref.CustomAttributes, usedT);
                    GenericInstanceType git = tref as GenericInstanceType;
                    AddUsedTypesFromGenericArgs(git, usedT);
                }
            }
        }
コード例 #4
0
        private void AddTypeToList(TypeReference tref, ClassUse use, List<UsedClass> usedT, bool getAdditionTypeInfo)
        {
            if (tref != null)
            {
                UsedClass uc = new UsedClass(tref, use);

                if (!SkipType(tref) && !usedT.Contains(uc))
                {
                    usedT.Add(uc);
                }
                if (getAdditionTypeInfo)
                {
                    AddUsedTypesFromAttributes(tref.CustomAttributes, usedT);
                    GenericInstanceType git = tref as GenericInstanceType;
                    AddUsedTypesFromGenericArgs(git, usedT);
                }
            }
        }