)>}]
شركة التطبيقات المتكاملة لتصميم وبرمجة البرمجيات الخاصة ش.ش.و.
Integrated Applications Programming Company
Home » Code Library » Translation (Ia.Islamic.Cl.Model)

Public general use code classes and xml files that we've compiled and used over the years:

Koran Reference Network Class Library support functions: Data model

    1: using System;
    2: using System.Web;
    3: using System.Xml;
    4: using System.Xml.XPath;
    5: using System.Xml.Xsl;
    6: using System.Configuration;
    7: using System.IO;
    8: using System.Text;
    9: using System.Collections;
   10: using System.Text.RegularExpressions;
   11: using System.Linq;
   12: using System.Xml.Linq;
   13: using System.Reflection;
   14: using System.Globalization;
   15:  
   16: namespace Ia.Islamic.Cl.Model
   17: {
   18:     ////////////////////////////////////////////////////////////////////////////
   19:  
   20:     /// <summary publish="true">
   21:     /// Koran Reference Network Class Library support functions: Data model
   22:     /// </summary>
   23:     /// <value>
   24:     /// https://msdn.microsoft.com/en-us/library/z1hkazw7(v=vs.100).aspx
   25:     /// </value>
   26:     /// <remarks> 
   27:     /// Copyright © 2001-2015 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   28:     ///
   29:     /// This library is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by
   30:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   31:     ///
   32:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   33:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   34:     /// 
   35:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   36:     /// 
   37:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   38:     /// </remarks> 
   39:     ////////////////////////////////////////////////////////////////////////////
   40:  
   41:     /// <summary>
   42:     /// 
   43:     /// </summary>
   44:     /// <remarks></remarks>
   45:     public class Translation
   46:     {
   47:         private static XDocument xd;
   48:         private XElement xe;
   49:  
   50:         /// <summary/>
   51:         public string Id { get; set; }
   52:         /// <summary/>
   53:         public string MainName { get; set; }
   54:         /// <summary/>
   55:         public string MainHome { get; set; }
   56:         /// <summary/>
   57:         public string MainTitle { get; set; }
   58:         /// <summary/>
   59:         public string MainMeta { get; set; }
   60:         /// <summary/>
   61:         public string MainBismillah { get; set; }
   62:         /// <summary/>
   63:         public string IntroductionName { get; set; }
   64:  
   65:         /// <summary/>
   66:         public string SearchTitle { get; set; }
   67:         /// <summary/>
   68:         public string SearchInstruction { get; set; }
   69:         /// <summary/>
   70:         public string SearchHintName { get; set; }
   71:         /// <summary/>
   72:         public string SearchHint { get; set; }
   73:         /// <summary/>
   74:         public string SearchButton { get; set; }
   75:         /// <summary/>
   76:         public string SearchCase { get; set; }
   77:         /// <summary/>
   78:         public string SearchBackwards { get; set; }
   79:  
   80:         /// <summary/>
   81:         public string ResultEmptyField { get; set; }
   82:         /// <summary/>
   83:         public string ResultTitle { get; set; }
   84:         /// <summary/>
   85:         public string ResultSpace { get; set; }
   86:         /// <summary/>
   87:         public string ResultPeriod { get; set; }
   88:         /// <summary/>
   89:         public string ResultComma { get; set; }
   90:         /// <summary/>
   91:         public string ResultOnly { get; set; }
   92:         /// <summary/>
   93:         public string ResultSearchForWord { get; set; }
   94:         /// <summary/>
   95:         public string ResultSearchForWordEnd { get; set; }
   96:         /// <summary/>
   97:         public string ResultSearchForWords { get; set; }
   98:         /// <summary/>
   99:         public string ResultSearchForWordsEnd { get; set; }
  100:         /// <summary/>
  101:         public string ResultQuoteOn { get; set; }
  102:         /// <summary/>
  103:         public string ResultQuoteOff { get; set; }
  104:         /// <summary/>
  105:         public string ResultAnd { get; set; }
  106:         /// <summary/>
  107:         public string ResultSearchIs { get; set; }
  108:         /// <summary/>
  109:         public string ResultSensitiveForWord { get; set; }
  110:         /// <summary/>
  111:         public string ResultSensitiveForWords { get; set; }
  112:         /// <summary/>
  113:         public string ResultWildcards { get; set; }
  114:         /// <summary/>
  115:         public string ResultTheWord { get; set; }
  116:         /// <summary/>
  117:         public string ResultTheWords { get; set; }
  118:         /// <summary/>
  119:         public string ResultWasNotFound { get; set; }
  120:         /// <summary/>
  121:         public string ResultWereNotFound { get; set; }
  122:         /// <summary/>
  123:         public string ResultAppearsIn { get; set; }
  124:         /// <summary/>
  125:         public string ResultNumberOfAppearWords { get; set; }
  126:         /// <summary/>
  127:         public string ResultOneVerse { get; set; }
  128:         /// <summary/>
  129:         public string ResultManyVerses { get; set; }
  130:         /// <summary/>
  131:         public string ResultNotAllTogether { get; set; }
  132:         /// <summary/>
  133:         public string ResultAll { get; set; }
  134:         /// <summary/>
  135:         public string ResultStartingVerse { get; set; }
  136:         /// <summary/>
  137:         public string ResultStartingVerseEnd { get; set; }
  138:         /// <summary/>
  139:         public string ResultNext { get; set; }
  140:  
  141:         ////////////////////////////////////////////////////////////////////////////
  142:  
  143:         /// <summary>
  144:         /// 
  145:         /// </summary>
  146:         public Translation(string langaugeId)
  147:         {
  148:             xe = (from q in XDocument.Elements("language").Elements("lang") where q.Attribute("symbol").Value == langaugeId select q).First();
  149:  
  150:             this.MainName = xe.Element("main").Attribute("name").Value;
  151:             this.MainHome = xe.Element("main").Element("home").Value;
  152:             this.MainTitle = xe.Element("main").Element("title").Value;
  153:             this.MainMeta = xe.Element("main").Element("meta").Value;
  154:             this.MainBismillah = xe.Element("main").Element("bismillah").Value;
  155:         
  156:             this.IntroductionName = xe.Element("intro").Attribute("name").Value;
  157:  
  158:             this.SearchTitle = xe.Element("search").Element("main").Element("title").Value;
  159:             this.SearchInstruction = xe.Element("search").Element("main").Element("instruction").Value;
  160:             this.SearchHintName = xe.Element("search").Element("main").Element("hint").Attribute("name").Value;
  161:             this.SearchHint = xe.Element("search").Element("main").Element("hint").Value;
  162:             this.SearchButton = xe.Element("search").Element("main").Element("button").Value;
  163:             this.SearchCase = xe.Element("search").Element("main").Element("case").Value;
  164:             this.SearchBackwards = xe.Element("search").Element("main").Element("backwards").Value;
  165:  
  166:             this.ResultEmptyField = xe.Element("search").Element("result").Element("empty_field").Value;
  167:             this.ResultTitle = xe.Element("search").Element("result").Element("title").Value;
  168:             this.ResultSpace = xe.Element("search").Element("result").Element("space").Value;
  169:             this.ResultPeriod = xe.Element("search").Element("result").Element("period").Value;
  170:             this.ResultComma = xe.Element("search").Element("result").Element("comma").Value;
  171:  
  172:             this.ResultOnly = xe.Element("search").Element("result").Element("only").Value;
  173:             this.ResultSearchForWord = xe.Element("search").Element("result").Element("search_for_word").Value;
  174:             this.ResultSearchForWords = xe.Element("search").Element("result").Element("search_for_words").Value;
  175:             this.ResultSearchForWordEnd = xe.Element("search").Element("result").Element("search_for_word_end").Value;
  176:             this.ResultSearchForWordsEnd = xe.Element("search").Element("result").Element("search_for_words_end").Value;
  177:             this.ResultQuoteOn = xe.Element("search").Element("result").Element("quote_on").Value;
  178:             this.ResultQuoteOff = xe.Element("search").Element("result").Element("quote_off").Value;
  179:             this.ResultAnd = xe.Element("search").Element("result").Element("and").Value;
  180:             this.ResultSearchIs = xe.Element("search").Element("result").Element("search_is").Value;
  181:             this.ResultSensitiveForWord = xe.Element("search").Element("result").Element("sensitive_for_word").Value;
  182:             this.ResultSensitiveForWords = xe.Element("search").Element("result").Element("sensitive_for_words").Value;
  183:             this.ResultWildcards = xe.Element("search").Element("result").Element("wildcards").Value;
  184:             this.ResultTheWord = xe.Element("search").Element("result").Element("the_word").Value;
  185:  
  186:             this.ResultWasNotFound = xe.Element("search").Element("result").Element("was_not_found").Value;
  187:             this.ResultTheWords = xe.Element("search").Element("result").Element("the_words").Value;
  188:             this.ResultWereNotFound = xe.Element("search").Element("result").Element("were_not_found").Value;
  189:             this.ResultAppearsIn = xe.Element("search").Element("result").Element("appears_in").Value;
  190:             this.ResultNumberOfAppearWords = xe.Element("search").Element("result").Element("number_of_appear_words").Value;
  191:             this.ResultOneVerse = xe.Element("search").Element("result").Element("one_verse").Value;
  192:  
  193:             this.ResultManyVerses = xe.Element("search").Element("result").Element("many_verses").Value;
  194:             this.ResultNotAllTogether = xe.Element("search").Element("result").Element("not_all_together").Value;
  195:             this.ResultAll = xe.Element("search").Element("result").Element("all").Value;
  196:             this.ResultStartingVerse = xe.Element("search").Element("result").Element("starting_verse").Value;
  197:             this.ResultStartingVerseEnd = xe.Element("search").Element("result").Element("starting_verse_end").Value;
  198:             this.ResultNext = xe.Element("search").Element("result").Element("next").Value;
  199:         }
  200:  
  201:         ////////////////////////////////////////////////////////////////////////////
  202:  
  203:         /// <summary>
  204:         /// 
  205:         /// How to embed and access resources by using Visual C# http://support.microsoft.com/kb/319292/en-us
  206:         /// 
  207:         /// 1. Change the "Build Action" property of your XML file from "Content" to "Embedded Resource".
  208:         /// 2. Add "using System.Reflection".
  209:         /// 3. Manifest resource stream will start with the project namespace, the location of XML file.
  210:         /// 
  211:         /// </summary>
  212:          
  213:         private XDocument XDocument
  214:         {
  215:             get
  216:             {
  217:                 Assembly assembly;
  218:                 StreamReader streamReader;
  219:  
  220:                 xd = null;
  221:                 assembly = Assembly.GetExecutingAssembly();
  222:                 streamReader = new StreamReader(assembly.GetManifestResourceStream("Ia.Islamic.Cl.Models.translation.xml"));
  223:  
  224:                 try
  225:                 {
  226:                     if (streamReader.Peek() != -1)
  227:                     {
  228:                         xd = System.Xml.Linq.XDocument.Load(streamReader);
  229:                     }
  230:                 }
  231:                 catch (Exception)
  232:                 {
  233:                 }
  234:                 finally
  235:                 {
  236:                 }
  237:  
  238:                 return xd;
  239:             }
  240:         }
  241:  
  242:         ////////////////////////////////////////////////////////////////////////////
  243:         ////////////////////////////////////////////////////////////////////////////
  244:     }
  245: }