예제 #1
0
        public string Compile(CompilationParams compilationParams)
        {
            var template =
                new SharpTLDefaultTemplate(new TemplateVars
            {
                Schema               = this,
                Namespace            = compilationParams.Namespace,
                MethodsInterfaceName = compilationParams.MethodsInterfaceName
            });

            return(template.TransformText());
        }
예제 #2
0
 public static string Compile(TLSchemaSourceType sourceType, string schemaText, CompilationParams compilationParams)
 {
     switch (sourceType)
     {
         case TLSchemaSourceType.TL:
             return CompileFromTL(schemaText, compilationParams);
         case TLSchemaSourceType.JSON:
             return CompileFromJson(schemaText, compilationParams);
         default:
             throw new ArgumentOutOfRangeException("sourceType");
     }
 }
예제 #3
0
 public string Compile(CompilationParams compilationParams)
 {
     var template =
         new SharpTLDefaultTemplate(new TemplateVars
         {
             Schema = this,
             Namespace = compilationParams.Namespace,
             MethodsInterfaceName = compilationParams.MethodsInterfaceName
         });
     return template.TransformText();
 }
예제 #4
0
        public static string CompileFromJson(string json, CompilationParams compilationParams)
        {
            TLSchema schema = FromJson(json);

            return(schema.Compile(compilationParams));
        }
예제 #5
0
 public static string CompileFromTL(string tlSchemaText, CompilationParams compilationParams)
 {
     TLSchema schema = FromTL(tlSchemaText);
     return schema.Compile(compilationParams);
 }
예제 #6
0
 public static string CompileFromJson(string json, CompilationParams compilationParams)
 {
     TLSchema schema = FromJson(json);
     return schema.Compile(compilationParams);
 }
예제 #7
0
        public static string CompileFromTL(string tlSchemaText, CompilationParams compilationParams)
        {
            TLSchema schema = FromTL(tlSchemaText);

            return(schema.Compile(compilationParams));
        }
예제 #8
0
        public static string Compile(TLSchemaSourceType sourceType, string schemaText, CompilationParams compilationParams)
        {
            switch (sourceType)
            {
            case TLSchemaSourceType.TL:
                return(CompileFromTL(schemaText, compilationParams));

            case TLSchemaSourceType.JSON:
                return(CompileFromJson(schemaText, compilationParams));

            default:
                throw new ArgumentOutOfRangeException("sourceType");
            }
        }