Beispiel #1
0
        string Render(InterfaceType interfaceType, string package = "myPackage", string @namespace = "MyNamespace", string typeName = "MyInterface")
        {
            Symbols.MapTypeToPackage(interfaceType.FullyQualifiedName, package);
            Symbols.MapNamespace(interfaceType.Namespace, @namespace);
            Symbols.MapTypeName(interfaceType.FullyQualifiedName, typeName, JsonModel.Spec.TypeKind.Interface);

            var generator = new InterfaceProxyGenerator(package, interfaceType, Symbols, Namespaces);

            SyntaxTree syntaxTree = generator.CreateSyntaxTree();

            return(syntaxTree.ToString());
        }
Beispiel #2
0
        string Render(InterfaceType interfaceType, string package = "myPackage", string @namespace = "MyNamespace",
                      string typeName = "MyInterface")
        {
            Symbols.MapTypeToPackage(interfaceType.FullyQualifiedName, package);
            string suffix = interfaceType.Namespace != null ? "." + interfaceType.Namespace : "";

            Symbols.MapNamespace(interfaceType.Assembly + suffix, @namespace);
            Symbols.MapTypeName(interfaceType.FullyQualifiedName, typeName, TypeKind.Interface);

            var generator = new InterfaceProxyGenerator(package, interfaceType, Symbols, Namespaces);

            SyntaxTree syntaxTree = generator.CreateSyntaxTree();

            return(syntaxTree.ToString());
        }