Example #1
0
 public Test(string connection, Way.EntityDB.DatabaseType dbType) : base(connection, dbType)
 {
     if (!setEvented)
     {
         lock (lockObj)
         {
             if (!setEvented)
             {
                 setEvented = true;
                 Way.EntityDB.DBContext.BeforeDelete += Database_BeforeDelete;
             }
         }
     }
 }
 public ServiceStatusViewer(string connection, Way.EntityDB.DatabaseType dbType, bool upgradeDatabase = true) : base(connection, dbType, upgradeDatabase)
 {
     if (!setEvented)
     {
         lock (lockObj)
         {
             if (!setEvented)
             {
                 setEvented = true;
                 Way.EntityDB.DBContext.BeforeDelete += Database_BeforeDelete;
             }
         }
     }
 }
Example #3
0
        static Config()
        {
            var         path   = Way.Lib.PlatformHelper.GetAppDirectory() + "config.xml";
            XmlDocument xmldoc = new XmlDocument();
            var         stream = System.IO.File.OpenRead(path);

            xmldoc.Load(stream);
            var node = xmldoc.DocumentElement.SelectSingleNode("db");

            ConnectionString = node.Attributes["ConnectionString"].InnerText;
            DbType           = Enum.Parse <Way.EntityDB.DatabaseType>(node.Attributes["Type"].InnerText);
            if (DbType == Way.EntityDB.DatabaseType.Sqlite)
            {
                ConnectionString = ConnectionString.Replace(".\\", Way.Lib.PlatformHelper.GetAppDirectory());
            }
        }