public void Verify(AssemblyGroup asmGroup, string typeName = null)
        {
            foreach (var type in asmGroup.Types)
            {
                if (typeName != null && typeName != type.FullName)
                    continue;

                var extendedInterfaces = type.Interfaces.Where(ifs => ifs.FullName.StartsWith("Akka.Interfaced.IExtendedInterface")).ToList();
                if (extendedInterfaces.Any())
                {
                    VerifiedTypes.Add(type.FullName);

                    var interfaceTypes = new List<TypeDefinition>();
                    foreach (var ifs in extendedInterfaces)
                    {
                        foreach (var arg in ((GenericInstanceType)ifs).GenericArguments)
                        {
                            var typeDef = asmGroup.GetType(arg);
                            if (typeDef != null)
                                interfaceTypes.Add(typeDef);
                            else
                                Errors.Add($"Cannot get type {arg.FullName} for {type.FullName}");
                        }
                    }
                    VerifyInterface(type, interfaceTypes.ToArray());
                }
            }
        }
Пример #2
0
        public void Verify(AssemblyGroup asmGroup, string typeName = null)
        {
            foreach (var type in asmGroup.Types)
            {
                if (typeName != null && typeName != type.FullName)
                {
                    continue;
                }

                var extendedInterfaces = type.Interfaces.Where(ifs => ifs.FullName.StartsWith("Akka.Interfaced.IExtendedInterface")).ToList();
                if (extendedInterfaces.Any())
                {
                    VerifiedTypes.Add(type.FullName);

                    var interfaceTypes = new List <TypeDefinition>();
                    foreach (var ifs in extendedInterfaces)
                    {
                        foreach (var arg in ((GenericInstanceType)ifs).GenericArguments)
                        {
                            var typeDef = asmGroup.GetType(arg);
                            if (typeDef != null)
                            {
                                interfaceTypes.Add(typeDef);
                            }
                            else
                            {
                                Errors.Add($"Cannot get type {arg.FullName} for {type.FullName}");
                            }
                        }
                    }
                    VerifyInterface(type, interfaceTypes.ToArray());
                }
            }
        }
Пример #3
0
        private static int Process(Options options)
        {
            try
            {
                Console.WriteLine("Start Verify: " + options.Input);

                var asmGroup = new AssemblyGroup(options.Input);
                var verifier = new ExtendedInterfaceVerifier(options);
                verifier.Verify(asmGroup);

                if (options.Verbose)
                {
                    foreach (var type in verifier.VerifiedTypes)
                    {
                        Console.WriteLine("VerifiedType: " + type);
                    }
                }

                if (verifier.Errors.Any())
                {
                    foreach (var error in verifier.Errors)
                    {
                        Console.WriteLine("! " + error);
                    }
                    return 1;
                }

                Console.WriteLine("Done.");
                return 0;
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception in processing:\n" + e);
                return 1;
            }
        }
Пример #4
0
        private static int Process(Options options)
        {
            try
            {
                Console.WriteLine("Start Verify: " + options.Input);

                var asmGroup = new AssemblyGroup(options.Input);
                var verifier = new ExtendedInterfaceVerifier(options);
                verifier.Verify(asmGroup);

                if (options.Verbose)
                {
                    foreach (var type in verifier.VerifiedTypes)
                    {
                        Console.WriteLine("VerifiedType: " + type);
                    }
                }

                if (verifier.Errors.Any())
                {
                    foreach (var error in verifier.Errors)
                    {
                        Console.WriteLine("! " + error);
                    }
                    return(1);
                }

                Console.WriteLine("Done.");
                return(0);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception in processing:\n" + e);
                return(1);
            }
        }