Exemple #1
0
 public override bool open(string configFile)
 {
     if (File.Exists(configFile))
     {
         StringTheory theory = new StringTheory();
         if (theory.LoadFile(configFile))
         {
             XmlDocument boxInfo = new XmlDocument();
             boxInfo.LoadXml(theory.ToString());
             this.setFilenameUsingConfigXml(boxInfo);
         }
     }
     return(this.LoadXmlDocument());
 }
Exemple #2
0
        protected bool LoadXmlDocument()
        {
            bool flag = false;

            if (File.Exists(this.Filename))
            {
                StringTheory theory = new StringTheory();
                if (theory.LoadFile(this.Filename))
                {
                    this.doc.LoadXml(theory.ToString());
                    flag = true;
                }
            }
            return(flag);
        }
Exemple #3
0
        public override bool open(string configFile)
        {
            bool         flag   = false;
            StringTheory theory = new StringTheory();

            if (theory.LoadFile(configFile))
            {
                XmlDocument info = new XmlDocument();
                info.LoadXml(theory.ToString());
                if (info != null)
                {
                    StringTheory theory2 = new StringTheory("0" + this.GetConfigurationItem("max_connections", info));
                    this.Config.setDatabaseType(this.GetConfigurationItem("db_type", info.DocumentElement));
                    this.Config.setDriver(this.GetConfigurationItem("driver", info.DocumentElement));
                    this.Config.setMaxConnections(theory2.ToInt());
                    this.Config.setServer(this.GetConfigurationItem("server", info.DocumentElement));
                    this.Config.setDatabase(this.GetConfigurationItem("database", info.DocumentElement));
                    this.Config.setUser(this.GetConfigurationItem("user", info.DocumentElement));
                    this.Config.setPassword(this.GetConfigurationItem("password", info.DocumentElement));
                    flag = this.open();
                }
            }
            return(flag);
        }
 public void testLoadFile()
 {
     StringTheory theory = new StringTheory();
     Assert.True(theory.LoadFile(@"C:\Built\Products\StringTheory\1.4\C#\_development\StringTheory\Built\UnitTests\justify.txt"), "Couldn't load file?");
     Assert.True(theory.Length > 0, "There should be some data in the file!");
     Assert.True(theory.Lines().Length > 1, "There should be many lines in the file!");
 }