Esempio n. 1
0
        private void GenerateDataContractAttribute(Type sourceType)
        {
            string dataContractNamespace, dataContractName;

            AttributeGeneratorHelper.GetContractNameAndNamespace(sourceType, out dataContractNamespace, out dataContractName);

            this.Write("[System.Runtime.Serialization.DataContract(Namespace = \"");

            this.Write(this.ToStringHelper.ToStringWithCulture(dataContractNamespace));

            this.Write("\"");


            if (!string.IsNullOrEmpty(dataContractName))
            {
                this.Write(", Name = \" ");

                this.Write(this.ToStringHelper.ToStringWithCulture(dataContractName));

                this.Write("\"");
            }

            this.Write(")]\r\n");
        }
Esempio n. 2
0
        private void GenerateDataContractAttribute(Type sourceType)
        {
            string dataContractNamespace, dataContractName;

            AttributeGeneratorHelper.GetContractNameAndNamespace(sourceType, out dataContractNamespace, out dataContractName);


        #line default
        #line hidden

        #line 69 "C:\Code\Repos\openriaservices\OpenRiaServices.DomainServices.Tools.TextTemplate\Framework\CSharpGenerators\Templates\AttributeGeneratorTemplate.ttinclude"
            this.Write("[System.Runtime.Serialization.DataContract(Namespace = \"");


        #line default
        #line hidden

        #line 70 "C:\Code\Repos\openriaservices\OpenRiaServices.DomainServices.Tools.TextTemplate\Framework\CSharpGenerators\Templates\AttributeGeneratorTemplate.ttinclude"
            this.Write(this.ToStringHelper.ToStringWithCulture(dataContractNamespace));


        #line default
        #line hidden

        #line 70 "C:\Code\Repos\openriaservices\OpenRiaServices.DomainServices.Tools.TextTemplate\Framework\CSharpGenerators\Templates\AttributeGeneratorTemplate.ttinclude"
            this.Write("\"");


        #line default
        #line hidden

        #line 70 "C:\Code\Repos\openriaservices\OpenRiaServices.DomainServices.Tools.TextTemplate\Framework\CSharpGenerators\Templates\AttributeGeneratorTemplate.ttinclude"

            if (!string.IsNullOrEmpty(dataContractName))
            {
        #line default
        #line hidden

        #line 73 "C:\Code\Repos\openriaservices\OpenRiaServices.DomainServices.Tools.TextTemplate\Framework\CSharpGenerators\Templates\AttributeGeneratorTemplate.ttinclude"
                this.Write(", Name = \" ");


        #line default
        #line hidden

        #line 73 "C:\Code\Repos\openriaservices\OpenRiaServices.DomainServices.Tools.TextTemplate\Framework\CSharpGenerators\Templates\AttributeGeneratorTemplate.ttinclude"
                this.Write(this.ToStringHelper.ToStringWithCulture(dataContractName));


        #line default
        #line hidden

        #line 73 "C:\Code\Repos\openriaservices\OpenRiaServices.DomainServices.Tools.TextTemplate\Framework\CSharpGenerators\Templates\AttributeGeneratorTemplate.ttinclude"
                this.Write("\"");


        #line default
        #line hidden

        #line 73 "C:\Code\Repos\openriaservices\OpenRiaServices.DomainServices.Tools.TextTemplate\Framework\CSharpGenerators\Templates\AttributeGeneratorTemplate.ttinclude"
            }


        #line default
        #line hidden

        #line 75 "C:\Code\Repos\openriaservices\OpenRiaServices.DomainServices.Tools.TextTemplate\Framework\CSharpGenerators\Templates\AttributeGeneratorTemplate.ttinclude"
            this.Write(")]\r\n");


        #line default
        #line hidden

        #line 76 "C:\Code\Repos\openriaservices\OpenRiaServices.DomainServices.Tools.TextTemplate\Framework\CSharpGenerators\Templates\AttributeGeneratorTemplate.ttinclude"
        }