コード例 #1
0
        private static bool DoesImportResolveType(
            Type type,
            ImportDecl import,
            IList<AssemblyIndex> assemblyIndices)
        {
            if (import.IsNamespaceImport)
            {
                var importName = $"{import.Namespace}.{type.Name}".Replace("@", "");
                return assemblyIndices.Any(assemblyIndex => assemblyIndex.CheckType(importName));
            }

            return import.TypeName == type.Name;
        }
コード例 #2
0
        public static void Importdecl(
            StringBuilder builder,
            ImportDecl importDecl)
        {
            builder.Append("using ");

            if (importDecl.IsNamespaceImport) {
                builder.Append(importDecl.Namespace);
            }
            else {
                builder.Append(importDecl.TypeName);
                builder.Append(" = ");
                builder.Append(importDecl.Namespace);
                builder.Append(".");
                builder.Append(importDecl.TypeName);
            }

            builder.Append(";\n");
        }