Esempio n. 1
0
        public virtual string TransformText()
        {
            this.Write(" \r\n");
            this.Write("\r\n");
            this.Write("\r\n\r\n");
            this.Write(" \r\n");
            this.Write("\r\n\r\n\r\n");

            #line 16 "E:\Projects\sfdocsamples\SF\T4\Generar_javascript\branches\1.1\Fwk.T4Gen\jsObservables.tt"

            EnvDTE.Project project  = Fwk.T4Gen.EntityModelToObservable.GetProject(this.Host);
            List <Type>    typeList = Fwk.T4Gen.EntityModelToObservable.GetDefinedTypesOnAllAssemblies(this.Host);


            string             outputFileName = "";
            string             targetDir      = this.Host.ResolveAssemblyReference("$(ProjectDir)");
            ObservableTemplate gen            = new ObservableTemplate();

            foreach (var type in typeList)
            {
                gen._type = type;
                String code = gen.TransformText();
                outputFileName = Path.Combine(targetDir, string.Concat(type.Name, ".js"));
                //gen.RenderToFile(outputFileName);
                //File.WriteAllText(outputFileName, this.GenerationEnvironment.ToString());
                //this.GenerationEnvironment.Remove(0, this.GenerationEnvironment.Length);
            }



            #line default
            #line hidden
            this.Write(" \r\n\r\n\r\n\r\n");
            return(this.GenerationEnvironment.ToString());
        }
Esempio n. 2
0
        public virtual string TransformText()
        {
            this.Write(" \r\n");
            this.Write("\r\n");
            this.Write("\r\n\r\n");
            this.Write(" \r\n");
            this.Write("\r\n\r\n\r\n");
            
            #line 16 "E:\Projects\sfdocsamples\SF\T4\Generar_javascript\branches\1.1\Fwk.T4Gen\jsObservables.tt"

EnvDTE.Project project = Fwk.T4Gen.EntityModelToObservable.GetProject(this.Host);  
List<Type> typeList = 	Fwk.T4Gen.EntityModelToObservable.GetDefinedTypesOnAllAssemblies(this.Host);


string outputFileName="";
string targetDir = this.Host.ResolveAssemblyReference("$(ProjectDir)");
ObservableTemplate gen = new ObservableTemplate();

foreach (var type in typeList)
    {
	    gen._type = type;
        String code = gen.TransformText();
		outputFileName = Path.Combine(targetDir,string.Concat(type.Name,".js"));
        //gen.RenderToFile(outputFileName);
        //File.WriteAllText(outputFileName, this.GenerationEnvironment.ToString());
        //this.GenerationEnvironment.Remove(0, this.GenerationEnvironment.Length);
    }
	

            
            #line default
            #line hidden
            this.Write(" \r\n\r\n\r\n\r\n");
            return this.GenerationEnvironment.ToString();
        }