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

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

FeatureDesignation Support class for TentPlay Trek data model

    1: using System;
    2: using System.Collections.Generic;
    3: using System.Linq;
    4: using System.Text;
    5: using System.Xml.Linq;
    6: using System.IO;
    7: using System.Reflection;
    8: using System.Collections;
    9:  
   10: namespace Ia.TentPlay.Cl.Models.Data.Trek
   11: {
   12:     ////////////////////////////////////////////////////////////////////////////
   13:  
   14:     /// <summary publish="true">
   15:     /// FeatureDesignation Support class for TentPlay Trek data model
   16:     /// </summary>
   17:     /// 
   18:     /// <remarks> 
   19:     /// Copyright © 2006-2024 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   20:     ///
   21:     /// 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
   22:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   23:     ///
   24:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   25:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   26:     /// 
   27:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   28:     /// 
   29:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   30:     /// </remarks> 
   31:     public class FeatureDesignation
   32:     {
   33:         private static XDocument xDocument;
   34:         private static List<Ia.TentPlay.Cl.Models.Trek.FeatureDesignation> featureDesignationList;
   35:         private static List<Ia.Cl.Models.Language> languageList;
   36:  
   37:         ////////////////////////////////////////////////////////////////////////////
   38:  
   39:         /// <summary>
   40:         ///
   41:         /// </summary>
   42:         public FeatureDesignation() { }
   43:  
   44:         ////////////////////////////////////////////////////////////////////////////
   45:  
   46:         /// <summary>
   47:         ///
   48:         /// </summary>
   49:         public static List<Ia.TentPlay.Cl.Models.Trek.FeatureDesignation> ListFromDatabase(out Ia.Cl.Models.Result result)
   50:         {
   51:             result = new Ia.Cl.Models.Result();
   52:  
   53:             featureDesignationList = new List<Ia.TentPlay.Cl.Models.Trek.FeatureDesignation>();
   54:  
   55:             using (var db = new Ia.TentPlay.Db())
   56:             {
   57:                 featureDesignationList = (from nfdc in db.FeatureDesignations select nfdc).ToList();
   58:             }
   59:  
   60:             result.AddSuccess("FeatureDesignation count: " + featureDesignationList.Count);
   61:  
   62:             return featureDesignationList;
   63:         }
   64:  
   65:         ////////////////////////////////////////////////////////////////////////////
   66:  
   67:         /// <summary>
   68:         ///
   69:         /// </summary>
   70:         public static List<Ia.Cl.Models.Language> LanguageList
   71:         {
   72:             get
   73:             {
   74:                 if (languageList == null || languageList.Count == 0)
   75:                 {
   76:                     languageList = new List<Ia.Cl.Models.Language>();
   77:  
   78:                     languageList.Add(new Ia.Cl.Models.Language("en"));
   79:                     languageList.Add(new Ia.Cl.Models.Language("ar"));
   80:                     languageList.Add(new Ia.Cl.Models.Language("da"));
   81:  
   82:                     languageList.Add(new Ia.Cl.Models.Language("zh_traditional"));
   83:                     languageList.Add(new Ia.Cl.Models.Language("zh_simplified"));
   84:  
   85:                     languageList.Add(new Ia.Cl.Models.Language("hi"));
   86:                     languageList.Add(new Ia.Cl.Models.Language("ja"));
   87:                     languageList.Add(new Ia.Cl.Models.Language("de"));
   88:                     languageList.Add(new Ia.Cl.Models.Language("ru"));
   89:                     languageList.Add(new Ia.Cl.Models.Language("pt"));
   90:                     languageList.Add(new Ia.Cl.Models.Language("id"));
   91:                     languageList.Add(new Ia.Cl.Models.Language("fr"));
   92:                     languageList.Add(new Ia.Cl.Models.Language("es"));
   93:                     languageList.Add(new Ia.Cl.Models.Language("it"));
   94:                     languageList.Add(new Ia.Cl.Models.Language("ko"));
   95:                     languageList.Add(new Ia.Cl.Models.Language("tr"));
   96:                     languageList.Add(new Ia.Cl.Models.Language("fa"));
   97:                     languageList.Add(new Ia.Cl.Models.Language("th"));
   98:                     languageList.Add(new Ia.Cl.Models.Language("ha"));
   99:                     languageList.Add(new Ia.Cl.Models.Language("ig"));
  100:                     languageList.Add(new Ia.Cl.Models.Language("yo"));
  101:                     languageList.Add(new Ia.Cl.Models.Language("pl"));
  102:                     languageList.Add(new Ia.Cl.Models.Language("ur"));
  103:                     languageList.Add(new Ia.Cl.Models.Language("nl"));
  104:                     languageList.Add(new Ia.Cl.Models.Language("ms"));
  105:                     languageList.Add(new Ia.Cl.Models.Language("tl"));
  106:                     languageList.Add(new Ia.Cl.Models.Language("af"));
  107:                     languageList.Add(new Ia.Cl.Models.Language("zu"));
  108:                     languageList.Add(new Ia.Cl.Models.Language("xh"));
  109:                     languageList.Add(new Ia.Cl.Models.Language("bn"));
  110:                     languageList.Add(new Ia.Cl.Models.Language("vi"));
  111:                     languageList.Add(new Ia.Cl.Models.Language("kk"));
  112:                     languageList.Add(new Ia.Cl.Models.Language("ro"));
  113:                     languageList.Add(new Ia.Cl.Models.Language("no"));
  114:                     languageList.Add(new Ia.Cl.Models.Language("uk"));
  115:                     languageList.Add(new Ia.Cl.Models.Language("cs"));
  116:                     languageList.Add(new Ia.Cl.Models.Language("he"));
  117:                     languageList.Add(new Ia.Cl.Models.Language("el"));
  118:                     languageList.Add(new Ia.Cl.Models.Language("my"));
  119:                     languageList.Add(new Ia.Cl.Models.Language("hu"));
  120:                     languageList.Add(new Ia.Cl.Models.Language("ga"));
  121:                     languageList.Add(new Ia.Cl.Models.Language("si"));
  122:                     languageList.Add(new Ia.Cl.Models.Language("ta"));
  123:                     languageList.Add(new Ia.Cl.Models.Language("fi"));
  124:                     languageList.Add(new Ia.Cl.Models.Language("uz"));
  125:                     languageList.Add(new Ia.Cl.Models.Language("az"));
  126:                     languageList.Add(new Ia.Cl.Models.Language("be"));
  127:                     languageList.Add(new Ia.Cl.Models.Language("sk"));
  128:                     languageList.Add(new Ia.Cl.Models.Language("am"));
  129:                     languageList.Add(new Ia.Cl.Models.Language("sw"));
  130:                     languageList.Add(new Ia.Cl.Models.Language("bg"));
  131:                     languageList.Add(new Ia.Cl.Models.Language("hr"));
  132:                     languageList.Add(new Ia.Cl.Models.Language("lt"));
  133:                     languageList.Add(new Ia.Cl.Models.Language("ne"));
  134:                     languageList.Add(new Ia.Cl.Models.Language("sl"));
  135:                     languageList.Add(new Ia.Cl.Models.Language("ps"));
  136:                     languageList.Add(new Ia.Cl.Models.Language("lb"));
  137:                     languageList.Add(new Ia.Cl.Models.Language("km"));
  138:                     languageList.Add(new Ia.Cl.Models.Language("lv"));
  139:                     languageList.Add(new Ia.Cl.Models.Language("bs"));
  140:                     languageList.Add(new Ia.Cl.Models.Language("et"));
  141:                     languageList.Add(new Ia.Cl.Models.Language("lo"));
  142:                     languageList.Add(new Ia.Cl.Models.Language("mn"));
  143:                     languageList.Add(new Ia.Cl.Models.Language("mg"));
  144:                     languageList.Add(new Ia.Cl.Models.Language("ka"));
  145:                     languageList.Add(new Ia.Cl.Models.Language("sq"));
  146:                     languageList.Add(new Ia.Cl.Models.Language("mk"));
  147:                     languageList.Add(new Ia.Cl.Models.Language("hy"));
  148:                     languageList.Add(new Ia.Cl.Models.Language("tg"));
  149:                     languageList.Add(new Ia.Cl.Models.Language("ky"));
  150:                     languageList.Add(new Ia.Cl.Models.Language("is"));
  151:                     languageList.Add(new Ia.Cl.Models.Language("mt"));
  152:                     languageList.Add(new Ia.Cl.Models.Language("ca"));
  153:                 }
  154:  
  155:                 return languageList;
  156:             }
  157:         }
  158:  
  159:         ////////////////////////////////////////////////////////////////////////////
  160:  
  161:         /// <summary>
  162:         ///
  163:         /// </summary>
  164:         public static List<Ia.TentPlay.Cl.Models.Trek.FeatureDesignation> List
  165:         {
  166:             get
  167:             {
  168:                 if (featureDesignationList == null || featureDesignationList.Count == 0)
  169:                 {
  170:                     Ia.TentPlay.Cl.Models.Trek.FeatureDesignation featureDesignationCode;
  171:  
  172:                     featureDesignationList = new List<Ia.TentPlay.Cl.Models.Trek.FeatureDesignation>();
  173:  
  174:                     foreach (XElement xe in XDocument.Element("featureDesignationList").Elements("featureDesignation"))
  175:                     {
  176:                         featureDesignationCode = new Ia.TentPlay.Cl.Models.Trek.FeatureDesignation();
  177:  
  178:                         featureDesignationCode.Id = xe.Attribute("id").Value;
  179:  
  180:                         featureDesignationCode.En = xe.Attribute("en").Value;
  181:                         featureDesignationCode.Ar = xe.Attribute("ar").Value;
  182:                         featureDesignationCode.Da = xe.Attribute("da").Value;
  183:                         featureDesignationCode.Zh_Simplified = xe.Attribute("zh_simplified").Value;
  184:                         featureDesignationCode.Zh_Traditional = xe.Attribute("zh_traditional").Value;
  185:                         featureDesignationCode.Hi = xe.Attribute("hi").Value;
  186:                         featureDesignationCode.Ja = xe.Attribute("ja").Value;
  187:                         featureDesignationCode.De = xe.Attribute("de").Value;
  188:                         featureDesignationCode.Ru = xe.Attribute("ru").Value;
  189:                         featureDesignationCode.Pt = xe.Attribute("pt").Value;
  190:                         featureDesignationCode._Id = xe.Attribute("_id").Value;
  191:                         featureDesignationCode.Fr = xe.Attribute("fr").Value;
  192:                         featureDesignationCode.Es = xe.Attribute("es").Value;
  193:                         featureDesignationCode.It = xe.Attribute("it").Value;
  194:                         featureDesignationCode.Ko = xe.Attribute("ko").Value;
  195:                         featureDesignationCode.Tr = xe.Attribute("tr").Value;
  196:                         featureDesignationCode.Fa = xe.Attribute("fa").Value;
  197:                         featureDesignationCode.Th = xe.Attribute("th").Value;
  198:                         featureDesignationCode.Ha = xe.Attribute("ha").Value;
  199:                         featureDesignationCode.Ig = xe.Attribute("ig").Value;
  200:                         featureDesignationCode.Yo = xe.Attribute("yo").Value;
  201:                         featureDesignationCode.Pl = xe.Attribute("pl").Value;
  202:                         featureDesignationCode.Ur = xe.Attribute("ur").Value;
  203:                         featureDesignationCode.Nl = xe.Attribute("nl").Value;
  204:                         featureDesignationCode.Ms = xe.Attribute("ms").Value;
  205:                         featureDesignationCode.Tl = xe.Attribute("tl").Value;
  206:                         featureDesignationCode.Af = xe.Attribute("af").Value;
  207:                         featureDesignationCode.Zu = xe.Attribute("zu").Value;
  208:                         featureDesignationCode.Xh = xe.Attribute("xh").Value;
  209:                         featureDesignationCode.Bn = xe.Attribute("bn").Value;
  210:                         featureDesignationCode.Vi = xe.Attribute("vi").Value;
  211:                         featureDesignationCode.Kk = xe.Attribute("kk").Value;
  212:                         featureDesignationCode.Ro = xe.Attribute("ro").Value;
  213:                         featureDesignationCode.No = xe.Attribute("no").Value;
  214:                         featureDesignationCode.Uk = xe.Attribute("uk").Value;
  215:                         featureDesignationCode.Cs = xe.Attribute("cs").Value;
  216:                         featureDesignationCode.He = xe.Attribute("he").Value;
  217:                         featureDesignationCode.El = xe.Attribute("el").Value;
  218:                         featureDesignationCode.My = xe.Attribute("my").Value;
  219:                         featureDesignationCode.Hu = xe.Attribute("hu").Value;
  220:                         featureDesignationCode.Ga = xe.Attribute("ga").Value;
  221:                         featureDesignationCode.Si = xe.Attribute("si").Value;
  222:                         featureDesignationCode.Ta = xe.Attribute("ta").Value;
  223:                         featureDesignationCode.Fi = xe.Attribute("fi").Value;
  224:                         featureDesignationCode.Uz = xe.Attribute("uz").Value;
  225:                         featureDesignationCode.Az = xe.Attribute("az").Value;
  226:                         featureDesignationCode.Be = xe.Attribute("be").Value;
  227:                         featureDesignationCode.Sk = xe.Attribute("sk").Value;
  228:                         featureDesignationCode.Am = xe.Attribute("am").Value;
  229:                         featureDesignationCode.Sw = xe.Attribute("sw").Value;
  230:                         featureDesignationCode.Bg = xe.Attribute("bg").Value;
  231:                         featureDesignationCode.Hr = xe.Attribute("hr").Value;
  232:                         featureDesignationCode.Lt = xe.Attribute("lt").Value;
  233:                         featureDesignationCode.Ne = xe.Attribute("ne").Value;
  234:                         featureDesignationCode.Sl = xe.Attribute("sl").Value;
  235:                         featureDesignationCode.Ps = xe.Attribute("ps").Value;
  236:                         featureDesignationCode.Lb = xe.Attribute("lb").Value;
  237:                         featureDesignationCode.Km = xe.Attribute("km").Value;
  238:                         featureDesignationCode.Lv = xe.Attribute("lv").Value;
  239:                         featureDesignationCode.Bs = xe.Attribute("bs").Value;
  240:                         featureDesignationCode.Et = xe.Attribute("et").Value;
  241:                         featureDesignationCode.Lo = xe.Attribute("lo").Value;
  242:                         featureDesignationCode.Mn = xe.Attribute("mn").Value;
  243:                         featureDesignationCode.Mg = xe.Attribute("mg").Value;
  244:                         featureDesignationCode.Ka = xe.Attribute("ka").Value;
  245:                         featureDesignationCode.Sq = xe.Attribute("sq").Value;
  246:                         featureDesignationCode.Mk = xe.Attribute("mk").Value;
  247:                         featureDesignationCode.Hy = xe.Attribute("hy").Value;
  248:                         featureDesignationCode.Tg = xe.Attribute("tg").Value;
  249:                         featureDesignationCode.Ky = xe.Attribute("ky").Value;
  250:                         featureDesignationCode.Is = xe.Attribute("is").Value;
  251:                         featureDesignationCode.Mt = xe.Attribute("mt").Value;
  252:                         featureDesignationCode.Ca = xe.Attribute("ca").Value;
  253:                         featureDesignationCode.Description = xe.Attribute("enDescription").Value;
  254:                         featureDesignationCode.Class = xe.Attribute("class").Value.Substring(0, 1); // read just the first letter of, say, "A - Administrative"
  255:  
  256:                         featureDesignationCode.Created = DateTime.UtcNow.AddHours(3);
  257:                         featureDesignationCode.Updated = DateTime.UtcNow.AddHours(3);
  258:  
  259:                         featureDesignationList.Add(featureDesignationCode);
  260:                     }
  261:                 }
  262:  
  263:                 return featureDesignationList;
  264:             }
  265:         }
  266:  
  267:         ////////////////////////////////////////////////////////////////////////////
  268:  
  269:         /// <summary>
  270:         ///
  271:         /// </summary>
  272:         public static Ia.TentPlay.Cl.Models.Trek.FeatureDesignation ById(string id)
  273:         {
  274:             var featureDesignation = (from fd in List where fd.Id == id select fd).SingleOrDefault();
  275:  
  276:             return featureDesignation;
  277:         }
  278:  
  279:         ////////////////////////////////////////////////////////////////////////////
  280:  
  281:         /// <summary>
  282:         ///
  283:         /// </summary>
  284:         public static Hashtable DesignationIdToClassIdHashtable
  285:         {
  286:             get
  287:             {
  288:                 Hashtable ht;
  289:  
  290:                 ht = new Hashtable();
  291:  
  292:                 foreach (Ia.TentPlay.Cl.Models.Trek.FeatureDesignation fd in Ia.TentPlay.Cl.Models.Data.Trek.FeatureDesignation.List)
  293:                 {
  294:                     ht[fd.Id] = fd.Class;
  295:                 }
  296:  
  297:                 return ht;
  298:             }
  299:         }
  300:  
  301:         ////////////////////////////////////////////////////////////////////////////
  302:  
  303:         /// <summary>
  304:         ///
  305:         /// </summary>
  306:         public static Hashtable DesignationIdToDesignationCaptionHashtable(string languageIso6391)
  307:         {
  308:             Hashtable ht;
  309:  
  310:             ht = new Hashtable();
  311:  
  312:             foreach (Ia.TentPlay.Cl.Models.Trek.FeatureDesignation fd in Ia.TentPlay.Cl.Models.Data.Trek.FeatureDesignation.List)
  313:             {
  314:                 switch (languageIso6391)
  315:                 {
  316:                     case "en": ht[fd.Id] = fd.En; break;
  317:                     case "ar": ht[fd.Id] = fd.Ar; break;
  318:                     case "da": ht[fd.Id] = fd.Da; break;
  319:                     case "zh_simplified": ht[fd.Id] = fd.Zh_Simplified; break;
  320:                     case "zh_traditional": ht[fd.Id] = fd.Zh_Traditional; break;
  321:                     case "hi": ht[fd.Id] = fd.Hi; break;
  322:                     case "ja": ht[fd.Id] = fd.Ja; break;
  323:                     case "de": ht[fd.Id] = fd.De; break;
  324:                     case "ru": ht[fd.Id] = fd.Ru; break;
  325:                     case "pt": ht[fd.Id] = fd.Pt; break;
  326:                     case "fr": ht[fd.Id] = fd.Fr; break;
  327:                     case "es": ht[fd.Id] = fd.Es; break;
  328:                     case "it": ht[fd.Id] = fd.It; break;
  329:                     case "ko": ht[fd.Id] = fd.Ko; break;
  330:                     case "tr": ht[fd.Id] = fd.Tr; break;
  331:                     case "fa": ht[fd.Id] = fd.Fa; break;
  332:                     case "th": ht[fd.Id] = fd.Th; break;
  333:                     case "ha": ht[fd.Id] = fd.Ha; break;
  334:                     case "ig": ht[fd.Id] = fd.Ig; break;
  335:                     case "yo": ht[fd.Id] = fd.Yo; break;
  336:                     case "pl": ht[fd.Id] = fd.Pl; break;
  337:                     case "ur": ht[fd.Id] = fd.Ur; break;
  338:                     case "nl": ht[fd.Id] = fd.Nl; break;
  339:                     case "ms": ht[fd.Id] = fd.Ms; break;
  340:                     case "tl": ht[fd.Id] = fd.Tl; break;
  341:                     case "af": ht[fd.Id] = fd.Af; break;
  342:                     case "zu": ht[fd.Id] = fd.Zu; break;
  343:                     case "xh": ht[fd.Id] = fd.Xh; break;
  344:                     case "bn": ht[fd.Id] = fd.Bn; break;
  345:                     case "vi": ht[fd.Id] = fd.Vi; break;
  346:                     case "kk": ht[fd.Id] = fd.Kk; break;
  347:                     case "ro": ht[fd.Id] = fd.Ro; break;
  348:                     case "no": ht[fd.Id] = fd.No; break;
  349:                     case "uk": ht[fd.Id] = fd.Uk; break;
  350:                     case "cs": ht[fd.Id] = fd.Cs; break;
  351:                     case "he": ht[fd.Id] = fd.He; break;
  352:                     case "el": ht[fd.Id] = fd.El; break;
  353:                     case "my": ht[fd.Id] = fd.My; break;
  354:                     case "hu": ht[fd.Id] = fd.Hu; break;
  355:                     case "ga": ht[fd.Id] = fd.Ga; break;
  356:                     case "si": ht[fd.Id] = fd.Si; break;
  357:                     case "ta": ht[fd.Id] = fd.Ta; break;
  358:                     case "fi": ht[fd.Id] = fd.Fi; break;
  359:                     case "uz": ht[fd.Id] = fd.Uz; break;
  360:                     case "az": ht[fd.Id] = fd.Az; break;
  361:                     case "be": ht[fd.Id] = fd.Be; break;
  362:                     case "sk": ht[fd.Id] = fd.Sk; break;
  363:                     case "am": ht[fd.Id] = fd.Am; break;
  364:                     case "sw": ht[fd.Id] = fd.Sw; break;
  365:                     case "bg": ht[fd.Id] = fd.Bg; break;
  366:                     case "hr": ht[fd.Id] = fd.Hr; break;
  367:                     case "lt": ht[fd.Id] = fd.Lt; break;
  368:                     case "ne": ht[fd.Id] = fd.Ne; break;
  369:                     case "sl": ht[fd.Id] = fd.Sl; break;
  370:                     case "ps": ht[fd.Id] = fd.Ps; break;
  371:                     case "lb": ht[fd.Id] = fd.Lb; break;
  372:                     case "km": ht[fd.Id] = fd.Km; break;
  373:                     case "lv": ht[fd.Id] = fd.Lv; break;
  374:                     case "bs": ht[fd.Id] = fd.Bs; break;
  375:                     case "et": ht[fd.Id] = fd.Et; break;
  376:                     case "lo": ht[fd.Id] = fd.Lo; break;
  377:                     case "mn": ht[fd.Id] = fd.Mn; break;
  378:                     case "mg": ht[fd.Id] = fd.Mg; break;
  379:                     case "ka": ht[fd.Id] = fd.Ka; break;
  380:                     case "sq": ht[fd.Id] = fd.Sq; break;
  381:                     case "mk": ht[fd.Id] = fd.Mk; break;
  382:                     case "hy": ht[fd.Id] = fd.Hy; break;
  383:                     case "tg": ht[fd.Id] = fd.Tg; break;
  384:                     case "ky": ht[fd.Id] = fd.Ky; break;
  385:                     case "is": ht[fd.Id] = fd.Is; break;
  386:                     case "mt": ht[fd.Id] = fd.Mt; break;
  387:                     case "ca": ht[fd.Id] = fd.Ca; break;
  388:  
  389:                     default: ht[fd.Id] = fd.En; break;
  390:                 }
  391:             }
  392:  
  393:             return ht;
  394:         }
  395:  
  396:         ////////////////////////////////////////////////////////////////////////////
  397:         ////////////////////////////////////////////////////////////////////////////
  398:  
  399:         /// <summary>
  400:         /// 
  401:         /// How to embed and access resources by using Visual C# http://support.microsoft.com/kb/319292/en-us
  402:         /// 
  403:         /// 1. Change the "Build Action" property of your XML file from "Content" to "Embedded Resource".
  404:         /// 2. Add "using System.Reflection".
  405:         /// 3. Manifest resource stream will start with the project namespace, the location of XML file.
  406:         /// 
  407:         /// </summary>
  408:  
  409:         private static XDocument XDocument
  410:         {
  411:             get
  412:             {
  413:                 Assembly assembly;
  414:                 StreamReader streamReader;
  415:  
  416:                 if (xDocument == null)
  417:                 {
  418:                     assembly = Assembly.GetExecutingAssembly();
  419:                     streamReader = new StreamReader(assembly.GetManifestResourceStream("Ia.TentPlay.Cl.Models.Data.Trek.feature-designation.xml"));
  420:  
  421:                     try
  422:                     {
  423:                         if (streamReader.Peek() != -1) xDocument = System.Xml.Linq.XDocument.Load(streamReader);
  424:                     }
  425:                     catch (Exception)
  426:                     {
  427:                     }
  428:                     finally
  429:                     {
  430:                     }
  431:                 }
  432:  
  433:                 return xDocument;
  434:             }
  435:         }
  436:  
  437:         ////////////////////////////////////////////////////////////////////////////
  438:         ////////////////////////////////////////////////////////////////////////////    
  439:     }
  440: }