Advertisement
Guest User

Untitled

a guest
Sep 8th, 2012
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.23 KB | None | 0 0
  1. //------------------------------------------------------------------------------
  2. // <auto-generated>
  3. //     This code was generated by a tool.
  4. //     Runtime Version:4.0.30319.239
  5. //
  6. //     Changes to this file may cause incorrect behavior and will be lost if
  7. //     the code is regenerated.
  8. // </auto-generated>
  9. //------------------------------------------------------------------------------
  10.  
  11. // Notice: Use of the service proxies that accompany this notice is subject to
  12. //            the terms and conditions of the license agreement located at
  13. //            http://go.microsoft.com/fwlink/?LinkID=202740
  14. //            If you do not agree to these terms you may not use this content.
  15. namespace Microsoft {
  16.     using System;
  17.     using System.Collections.Generic;
  18.     using System.Data.Services.Client;
  19.     using System.Net;
  20.     using System.IO;
  21.    
  22.    
  23.     public partial class Translation {
  24.        
  25.         private String _Text;
  26.        
  27.         public String Text {
  28.             get {
  29.                 return this._Text;
  30.             }
  31.             set {
  32.                 this._Text = value;
  33.             }
  34.         }
  35.     }
  36.    
  37.     public partial class Language {
  38.        
  39.         private String _Code;
  40.        
  41.         public String Code {
  42.             get {
  43.                 return this._Code;
  44.             }
  45.             set {
  46.                 this._Code = value;
  47.             }
  48.         }
  49.     }
  50.    
  51.     public partial class DetectedLanguage {
  52.        
  53.         private String _Code;
  54.        
  55.         public String Code {
  56.             get {
  57.                 return this._Code;
  58.             }
  59.             set {
  60.                 this._Code = value;
  61.             }
  62.         }
  63.     }
  64.    
  65.     public partial class TranslatorContainer : System.Data.Services.Client.DataServiceContext {
  66.        
  67.         public TranslatorContainer(Uri serviceRoot) :
  68.                 base(serviceRoot) {
  69.         }
  70.        
  71.         /// <summary>
  72.         /// </summary>
  73.         /// <param name="Text">the text to translate Sample Values : hello</param>
  74.         /// <param name="To">the language code to translate the text into Sample Values : nl</param>
  75.         /// <param name="From">the language code of the translation text Sample Values : en</param>
  76.         public DataServiceQuery<Translation> Translate(String Text, String To, String From) {
  77.             if ((Text == null)) {
  78.                 throw new System.ArgumentNullException("Text", "Text value cannot be null");
  79.             }
  80.             if ((To == null)) {
  81.                 throw new System.ArgumentNullException("To", "To value cannot be null");
  82.             }
  83.             DataServiceQuery<Translation> query;
  84.             query = base.CreateQuery<Translation>("Translate");
  85.             if ((Text != null)) {
  86.                 query = query.AddQueryOption("Text", string.Concat("\'", System.Uri.EscapeDataString(Text), "\'"));
  87.             }
  88.             if ((To != null)) {
  89.                 query = query.AddQueryOption("To", string.Concat("\'", System.Uri.EscapeDataString(To), "\'"));
  90.             }
  91.             if ((From != null)) {
  92.                 query = query.AddQueryOption("From", string.Concat("\'", System.Uri.EscapeDataString(From), "\'"));
  93.             }
  94.             return query;
  95.         }
  96.        
  97.         /// <summary>
  98.         /// </summary>
  99.         public DataServiceQuery<Language> GetLanguagesForTranslation() {
  100.             DataServiceQuery<Language> query;
  101.             query = base.CreateQuery<Language>("GetLanguagesForTranslation");
  102.             return query;
  103.         }
  104.        
  105.         /// <summary>
  106.         /// </summary>
  107.         /// <param name="Text">the text whose language is to be identified Sample Values : hello</param>
  108.         public DataServiceQuery<DetectedLanguage> Detect(String Text) {
  109.             if ((Text == null)) {
  110.                 throw new System.ArgumentNullException("Text", "Text value cannot be null");
  111.             }
  112.             DataServiceQuery<DetectedLanguage> query;
  113.             query = base.CreateQuery<DetectedLanguage>("Detect");
  114.             if ((Text != null)) {
  115.                 query = query.AddQueryOption("Text", string.Concat("\'", System.Uri.EscapeDataString(Text), "\'"));
  116.             }
  117.             return query;
  118.         }
  119.     }
  120. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement