当前位置: 首页>>代码示例>>C#>>正文


C# Quote.ToXmlString方法代码示例

本文整理汇总了C#中Quote.ToXmlString方法的典型用法代码示例。如果您正苦于以下问题:C# Quote.ToXmlString方法的具体用法?C# Quote.ToXmlString怎么用?C# Quote.ToXmlString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Quote的用法示例。


在下文中一共展示了Quote.ToXmlString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ToXmlStringProvisioningTest

        public void ToXmlStringProvisioningTest()
        {
            var oldCulture = Thread.CurrentThread.CurrentCulture;
            try
            {

                Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("de-DE");

                string projectsXml = @"
            <Projects>
                    <Project>
                        <ProjectID>999</ProjectID>
                        <ProjectName>Name of project</ProjectName>
                        <ServiceID>54</ServiceID>
                        <SourceLanguage>
                            <LanguageCode>en-gb</LanguageCode>
                        </SourceLanguage>
                        <TargetLanguages>
                                    <TargetLanguage>
                                        <LanguageCode>it-it</LanguageCode>
                                    </TargetLanguage>
                                    <TargetLanguage>
                                        <LanguageCode>fr-fr</LanguageCode>
                                    </TargetLanguage>
                        </TargetLanguages>
                        <Products>
                                <Product>
                                    <AssetID>999</AssetID>
                                    <SKUs>
                                        <SKU>
                                            <SKUNumber>123</SKUNumber>
                                        </SKU>
                                    </SKUs>
                                    <DueDate>2014-02-11T10:22:46Z</DueDate>
                                </Product>
                        </Products>
                        <ReferenceFiles>
                            <ReferenceFile>
                                <AssetID>12345</AssetID>
                                <FileName>my-file.txt</FileName>
                                <URL>https://ondemand.liondemand.com/api/files/12345</URL>
                                <TargetLanguages></TargetLanguages>
                            </ReferenceFile>
                            <ReferenceFile>
                                <AssetID>12346</AssetID>
                                <FileName>my-file.txt</FileName>
                                <URL>https://ondemand.liondemand.com/api/files/12346</URL>
                                <TargetLanguages></TargetLanguages>
                            </ReferenceFile>
                        </ReferenceFiles>
                    </Project>
            </Projects>
            ";

                XDocument document = XDocument.Parse(projectsXml);

                IEnumerable<Project> projects = Project.CreateEnumerable(document.Element("Projects"), new MockContentAPI());

                var quote = new Quote(quoteID: 795,
                                      creationDate: DateTime.Parse("2014-06-25T16:39:07Z"),
                                      totalTranslations: 2,
                                      translationCredit: 49984,
                                      totalCost: 0.00m,
                                      prepaidCredit: 118.99m,
                                      amountDue: 0.00m,
                                      currency: "EUR",
                                      projects: projects) { InternalBillingCode = "ABCD100001", PurchaseOrderNumber = "001-005-100" };

                string xml = @"
                <Quote>
                    <QuoteID>795</QuoteID>
                    <CreationDate>2014-06-25T16:39:07Z</CreationDate>
                    <TotalTranslations>2</TotalTranslations>
                    <TranslationCredit>49984</TranslationCredit>
                    <TotalCost>0.00</TotalCost>
                    <PrepaidCredit>118.99</PrepaidCredit>
                    <AmountDue>0.00</AmountDue>
                    <Currency>EUR</Currency>
                    <PurchaseOrderNumber>001-005-100</PurchaseOrderNumber>
                    <InternalBillingCode>ABCD100001</InternalBillingCode>
                    <Projects>
                            <Project>
                                <ProjectID>999</ProjectID>
                                <ProjectName>Name of project</ProjectName>
                                <ServiceID>54</ServiceID>
                                <SourceLanguage>
                                    <LanguageCode>en-gb</LanguageCode>
                                </SourceLanguage>
                                <TargetLanguages>
                                            <TargetLanguage>
                                                <LanguageCode>it-it</LanguageCode>
                                            </TargetLanguage>
                                            <TargetLanguage>
                                                <LanguageCode>fr-fr</LanguageCode>
                                            </TargetLanguage>
                                </TargetLanguages>
                                <Products>
                                        <Product>
                                            <AssetID>999</AssetID>
                                            <SKUs>
//.........这里部分代码省略.........
开发者ID:JackMiszencin,项目名称:lionbridge-ondemand-client-csharp,代码行数:101,代码来源:QuoteTest.cs

示例2: ToXmlStringPayAsYouGoTest

        public void ToXmlStringPayAsYouGoTest()
        {
            string projectsXml = @"
            <Projects>
                    <Project>
                        <ProjectID>999</ProjectID>
                        <ProjectName>Name of project</ProjectName>
                        <ServiceID>54</ServiceID>
                        <SourceLanguage>
                            <LanguageCode>en-gb</LanguageCode>
                        </SourceLanguage>
                        <TargetLanguages>
                                    <TargetLanguage>
                                        <LanguageCode>it-it</LanguageCode>
                                    </TargetLanguage>
                                    <TargetLanguage>
                                        <LanguageCode>fr-fr</LanguageCode>
                                    </TargetLanguage>
                        </TargetLanguages>
                        <Products>
                                <Product>
                                    <AssetID>999</AssetID>
                                    <SKUs>
                                        <SKU>
                                            <SKUNumber>123</SKUNumber>
                                        </SKU>
                                    </SKUs>
                                    <DueDate>2014-02-11T10:22:46Z</DueDate>
                                </Product>
                        </Products>
                        <ReferenceFiles>
                            <ReferenceFile>
                                <AssetID>12345</AssetID>
                                <FileName>my-file.txt</FileName>
                                <URL>https://ondemand.liondemand.com/api/files/12345</URL>
                                <TargetLanguages></TargetLanguages>
                            </ReferenceFile>
                            <ReferenceFile>
                                <AssetID>12346</AssetID>
                                <FileName>my-file.txt</FileName>
                                <URL>https://ondemand.liondemand.com/api/files/12346</URL>
                                <TargetLanguages></TargetLanguages>
                            </ReferenceFile>
                        </ReferenceFiles>
                    </Project>
            </Projects>
            ";

            XDocument document = XDocument.Parse(projectsXml);

            IEnumerable<Project> projects = Project.CreateEnumerable(document.Element("Projects"), new MockContentAPI());

            var quote = new Quote(quoteID: 795,
                                  creationDate: DateTime.Parse("2014-06-25T16:39:07Z"),
                                  totalTranslations: 2,
                                  translationCredit: 49984,
                                  totalCost: 0.00m,
                                  prepaidCredit: 118.99m,
                                  amountDue: 0.00m,
                                  currency: "EUR",
                                  projects: projects);

            string xml = @"
                <Quote>
                    <QuoteID>795</QuoteID>
                    <CreationDate>2014-06-25T16:39:07Z</CreationDate>
                    <TotalTranslations>2</TotalTranslations>
                    <TranslationCredit>49984</TranslationCredit>
                    <TotalCost>0.00</TotalCost>
                    <PrepaidCredit>118.99</PrepaidCredit>
                    <AmountDue>0.00</AmountDue>
                    <Currency>EUR</Currency>
                    <Projects>
                            <Project>
                                <ProjectID>999</ProjectID>
                                <ProjectName>Name of project</ProjectName>
                                <ServiceID>54</ServiceID>
                                <SourceLanguage>
                                    <LanguageCode>en-gb</LanguageCode>
                                </SourceLanguage>
                                <TargetLanguages>
                                            <TargetLanguage>
                                                <LanguageCode>it-it</LanguageCode>
                                            </TargetLanguage>
                                            <TargetLanguage>
                                                <LanguageCode>fr-fr</LanguageCode>
                                            </TargetLanguage>
                                </TargetLanguages>
                                <Products>
                                        <Product>
                                            <AssetID>999</AssetID>
                                            <SKUs>
                                                <SKU>
                                                    <SKUNumber>123</SKUNumber>
                                                </SKU>
                                            </SKUs>
                                            <DueDate>2014-02-11T10:22:46Z</DueDate>
                                        </Product>
                                </Products>
                                <ReferenceFiles>
//.........这里部分代码省略.........
开发者ID:JackMiszencin,项目名称:lionbridge-ondemand-client-csharp,代码行数:101,代码来源:QuoteTest.cs


注:本文中的Quote.ToXmlString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。