Add() public method

public Add ( UpgradeScript script ) : void
script UpgradeScript
return void
Beispiel #1
0
        public bool CreateUpgradePath()
        {
            _upgradePath = new UpgradeScripts();

             int from = _application.Database.CurrentVersion;
             int to = _application.Database.RequiredVersion;

             // Actually create the path.
             while (from != to)
             {
            UpgradeScript script = _upgradeScripts.GetScriptUpgradingFrom(from);

            if (script == null)
            {
               MessageBox.Show("Upgrade path not found. Please contact support", "hMailServer");
               return false;
            }

            string fileName = GetScriptFileName(script);

            if (!File.Exists(fileName))
            {
               MessageBox.Show("Required file for upgrade not found:" + Environment.NewLine + fileName, "hMailServer");
               return false;
            }

            _upgradePath.Add(script);

            from = script.To;
             }

             DisplayUpgradePath();

             return true;
        }
Beispiel #2
0
        public bool CreateUpgradePath()
        {
            _upgradePath = new UpgradeScripts();

            int from = _application.Database.CurrentVersion;
            int to   = _application.Database.RequiredVersion;


            // Actually create the path.
            while (from != to)
            {
                UpgradeScript script = _upgradeScripts.GetScriptUpgradingFrom(from);

                if (script == null)
                {
                    MessageBox.Show("Upgrade path not found. Please contact support", "hMailServer");
                    return(false);
                }

                string fileName = GetScriptFileName(script);

                if (!File.Exists(fileName))
                {
                    MessageBox.Show("Required file for upgrade not found:" + Environment.NewLine + fileName, "hMailServer");
                    return(false);
                }

                _upgradePath.Add(script);

                from = script.To;
            }

            DisplayUpgradePath();

            return(true);
        }
Beispiel #3
0
 private void LoadScripts()
 {
     _upgradeScripts.Add(new UpgradeScript(0, 1100));
     _upgradeScripts.Add(new UpgradeScript(1100, 1200));
     _upgradeScripts.Add(new UpgradeScript(1200, 1400));
     _upgradeScripts.Add(new UpgradeScript(1400, 1410));
     _upgradeScripts.Add(new UpgradeScript(1410, 1500));
     _upgradeScripts.Add(new UpgradeScript(1500, 1600));
     _upgradeScripts.Add(new UpgradeScript(1600, 1700));
     _upgradeScripts.Add(new UpgradeScript(1700, 2000));
     _upgradeScripts.Add(new UpgradeScript(2000, 3000));
     _upgradeScripts.Add(new UpgradeScript(3000, 3001));
     _upgradeScripts.Add(new UpgradeScript(3001, 3100));
     _upgradeScripts.Add(new UpgradeScript(3100, 3200));
     _upgradeScripts.Add(new UpgradeScript(3200, 3300));
     _upgradeScripts.Add(new UpgradeScript(3300, 3301));
     _upgradeScripts.Add(new UpgradeScript(3301, 3400));
     _upgradeScripts.Add(new UpgradeScript(3400, 3401));
     _upgradeScripts.Add(new UpgradeScript(3401, 3402));
     _upgradeScripts.Add(new UpgradeScript(3402, 4000));
     _upgradeScripts.Add(new UpgradeScript(4000, 4100));
     _upgradeScripts.Add(new UpgradeScript(4100, 4200));
     _upgradeScripts.Add(new UpgradeScript(4200, 4300));
     _upgradeScripts.Add(new UpgradeScript(4300, 4301));
     _upgradeScripts.Add(new UpgradeScript(4301, 4400));
     _upgradeScripts.Add(new UpgradeScript(4400, 4401));
     _upgradeScripts.Add(new UpgradeScript(4401, 4402));
     _upgradeScripts.Add(new UpgradeScript(4402, 5000));
     _upgradeScripts.Add(new UpgradeScript(5000, 5001));
     _upgradeScripts.Add(new UpgradeScript(5001, 5002));
     _upgradeScripts.Add(new UpgradeScript(5002, 5003));
     _upgradeScripts.Add(new UpgradeScript(5003, 5004));
     _upgradeScripts.Add(new UpgradeScript(5004, 5005));
     _upgradeScripts.Add(new UpgradeScript(5005, 5006));
     _upgradeScripts.Add(new UpgradeScript(5006, 5100));
     _upgradeScripts.Add(new UpgradeScript(5100, 5110));
     _upgradeScripts.Add(new UpgradeScript(5110, 5200));
     _upgradeScripts.Add(new UpgradeScript(5200, 5201));
     _upgradeScripts.Add(new UpgradeScript(5201, 5300));
     _upgradeScripts.Add(new UpgradeScript(5300, 5310));
     _upgradeScripts.Add(new UpgradeScript(5310, 5320));
     _upgradeScripts.Add(new UpgradeScript(5320, 5400));
     _upgradeScripts.Add(new UpgradeScript(5400, 5500));
     _upgradeScripts.Add(new UpgradeScript(5500, 5501));
     _upgradeScripts.Add(new UpgradeScript(5501, 5502));
     _upgradeScripts.Add(new UpgradeScript(5502, 5600));
     _upgradeScripts.Add(new UpgradeScript(5600, 5601));
     _upgradeScripts.Add(new UpgradeScript(5601, 5700));
 }