Boo.Lang.Compiler.Steps.MergePartialTypes.MergeImports C# (CSharp) Метод

MergeImports() статический приватный Метод

static private MergeImports ( Boo.Lang.Compiler.Ast.TypeDefinition from, Boo.Lang.Compiler.Ast.TypeDefinition to ) : void
from Boo.Lang.Compiler.Ast.TypeDefinition
to Boo.Lang.Compiler.Ast.TypeDefinition
Результат void
        static void MergeImports(TypeDefinition from, TypeDefinition to)
        {
            Module fromModule = from.EnclosingModule;
            Module toModule = to.EnclosingModule;
            if (fromModule == toModule) return;
            if (toModule.ContainsAnnotation(fromModule)) return;

            toModule.Imports.ExtendWithClones(fromModule.Imports.Where(i => !toModule.Imports.Any(i2 => i.Matches(i2))));
            // annotate so we remember not to merge the imports
            // again in the future
            toModule.Annotate(fromModule);

            //annotate so that we know these modules have been merged
            //this is used by checkneverusedmembers step
            if (!fromModule.ContainsAnnotation("merged-module"))
                fromModule.Annotate("merged-module");
            if (!toModule.ContainsAnnotation("merged-module"))
                toModule.Annotate("merged-module");
        }