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

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

    1: using System;
    2: using System.Configuration;
    3: using System.Data;
    4: using System.Reflection;
    5: using System.Xml.Linq;
    6: using System.IO;
    7:  
    8: namespace Ia.Simple.Cl.Models.Data.SmartDeals
    9: {
   10:     ////////////////////////////////////////////////////////////////////////////
   11:  
   12:     /// <summary publish="true">
   13:     ///
   14:     /// </summary>
   15:     /// 
   16:     /// <remarks> 
   17:     /// Copyright © 2006-2025 Jasem Y. Al-Shamlan (info@ia.com.kw), Integrated Applications - Kuwait. All Rights Reserved.
   18:     ///
   19:     /// 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
   20:     /// the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
   21:     ///
   22:     /// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
   23:     /// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
   24:     /// 
   25:     /// You should have received a copy of the GNU General Public License along with this library. If not, see http://www.gnu.org/licenses.
   26:     /// 
   27:     /// Copyright notice: This notice may not be removed or altered from any source distribution.
   28:     /// </remarks> 
   29:     public class Default
   30:     {
   31:         private static XDocument xDocument;
   32:  
   33:         ////////////////////////////////////////////////////////////////////////////
   34:  
   35:         /// <summary>
   36:         ///
   37:         /// </summary>
   38:         public Default()
   39:         {
   40:         }
   41:  
   42:         ////////////////////////////////////////////////////////////////////////////
   43:         ////////////////////////////////////////////////////////////////////////////
   44:  
   45:         /// <summary>
   46:         /// 
   47:         /// How to embed and access resources by using Visual C# http://support.microsoft.com/kb/319292/en-us
   48:         /// 
   49:         /// 1. Change the "Build Action" property of your XML file from "Content" to "Embedded Resource".
   50:         /// 2. Add "using System.Reflection".
   51:         /// 3. Manifest resource stream will start with the project namespace, the location of XML file.
   52:         /// 
   53:         /// </summary>
   54:         public static XDocument XDocument
   55:         {
   56:             get
   57:             {
   58:                 Assembly assembly;
   59:                 StreamReader streamReader;
   60:  
   61:                 xDocument = null;
   62:                 assembly = Assembly.GetExecutingAssembly();
   63:                 streamReader = new StreamReader(assembly.GetManifestResourceStream("Ia.Simple.Cl.Models.Data.SmartDeals.default.xml"));
   64:  
   65:                 try
   66:                 {
   67:                     if (streamReader.Peek() != -1)
   68:                     {
   69:                         xDocument = System.Xml.Linq.XDocument.Load(streamReader);
   70:                     }
   71:                 }
   72:                 catch (Exception)
   73:                 {
   74:                 }
   75:                 finally
   76:                 {
   77:                 }
   78:  
   79:                 return xDocument;
   80:             }
   81:         }
   82:  
   83:         ////////////////////////////////////////////////////////////////////////////
   84:         ////////////////////////////////////////////////////////////////////////////
   85:     }
   86:  
   87:     ////////////////////////////////////////////////////////////////////////////
   88:     ////////////////////////////////////////////////////////////////////////////
   89: }