internal void Populate(ArchAngel.Interfaces.ProjectOptions.DatabaseScripts.MaintenanceScript script, string scriptType)
        {
            Script            = script;
            CurrentScriptType = scriptType;

            switch (scriptType)
            {
            case "Default":
                SetText(Script.Header);
                break;

            //case "Header":
            //    SetText(Script.Header);
            //    break;
            //case "Create":
            //    SetText(Script.Create);
            //    break;
            //case "Update":
            //    SetText(Script.Update);
            //    break;
            //case "Delete":
            //    SetText(Script.Delete);
            //    break;
            default:
                throw new NotImplementedException("Script type not handled yet: " + scriptType);
            }
            if (!IntelliSenseIsInitialized)
            {
                SetupIntelliSense();
            }
        }
        internal void Populate(ArchAngel.Interfaces.ProjectOptions.DatabaseScripts.MaintenanceScript script, string scriptType)
        {
            Script = script;
            CurrentScriptType = scriptType;

            switch (scriptType)
            {
                case "Default":
                    SetText(Script.Header);
                    break;
                //case "Header":
                //    SetText(Script.Header);
                //    break;
                //case "Create":
                //    SetText(Script.Create);
                //    break;
                //case "Update":
                //    SetText(Script.Update);
                //    break;
                //case "Delete":
                //    SetText(Script.Delete);
                //    break;
                default:
                    throw new NotImplementedException("Script type not handled yet: " + scriptType);
            }
            if (!IntelliSenseIsInitialized)
                SetupIntelliSense();
        }
Exemple #3
0
        private void treeSettings_AfterNodeSelect(object sender, DevComponents.AdvTree.AdvTreeNodeEventArgs e)
        {
            //baseTypeMapEditor1.Save();
            dbTypeMapEditor1.Save();
            databaseScriptEditor1.Save();
            namingEditor1.Save();

            if (e.Node == nodeTypeMapsBase)
            {
                ShowControl(baseTypeMapEditor1);
                //baseTypeMapEditor1.Populate(ArchAngel.Interfaces.ProjectOptions.DatabaseScripts.Utility.SqlServerScript, "Delete Table");
            }
            else if (e.Node == nodeTypeMapsSqlServer)
            {
                ShowControl(dbTypeMapEditor1);
                dbTypeMapEditor1.Populate("Sql Server");
            }
            else if (e.Node == nodeTypeMapsOracle)
            {
                ShowControl(dbTypeMapEditor1);
                dbTypeMapEditor1.Populate("Oracle");
            }
            else if (e.Node == nodeTypeMapsMySQL)
            {
                ShowControl(dbTypeMapEditor1);
                dbTypeMapEditor1.Populate("MySQL");
            }
            else if (e.Node == nodeTypeMapsPostgreSQL)
            {
                ShowControl(dbTypeMapEditor1);
                dbTypeMapEditor1.Populate("PostgreSQL");
            }
            else if (e.Node == nodeTypeMapsFirebird)
            {
                ShowControl(dbTypeMapEditor1);
                dbTypeMapEditor1.Populate("Firebird");
            }
            else if (e.Node == nodeTypeMapsSQLite)
            {
                ShowControl(dbTypeMapEditor1);
                dbTypeMapEditor1.Populate("SQLite");
            }
            else if (e.Node == nodeNamingScriptEntity)
            {
                ShowControl(namingEditor1);
                namingEditor1.Populate(NamingEditor.NamingTypes.Entity, ArchAngel.Interfaces.ProjectOptions.ModelScripts.Utility.EntityNamingScript);
            }
            else if (e.Node == nodeNamingScriptProperty)
            {
                ShowControl(namingEditor1);
                namingEditor1.Populate(NamingEditor.NamingTypes.Property, ArchAngel.Interfaces.ProjectOptions.ModelScripts.Utility.PropertyNamingScript);
            }
            else if (e.Node.Parent != null)
            {
                ArchAngel.Interfaces.ProjectOptions.DatabaseScripts.MaintenanceScript script = null;

                if (e.Node.Parent.Text == "SQL Server")
                {
                    script = ArchAngel.Interfaces.ProjectOptions.DatabaseScripts.Utility.SqlServerScript;
                }
                else if (e.Node.Parent.Text == "Oracle")
                {
                    script = ArchAngel.Interfaces.ProjectOptions.DatabaseScripts.Utility.OracleScript;
                }
                else if (e.Node.Parent.Text == "MySQL")
                {
                    script = ArchAngel.Interfaces.ProjectOptions.DatabaseScripts.Utility.MySqlScript;
                }
                else if (e.Node.Parent.Text == "PostgreSQL")
                {
                    script = ArchAngel.Interfaces.ProjectOptions.DatabaseScripts.Utility.PostgreSqlScript;
                }
                else if (e.Node.Parent.Text == "Firebird")
                {
                    script = ArchAngel.Interfaces.ProjectOptions.DatabaseScripts.Utility.FirebirdScript;
                }
                else if (e.Node.Parent.Text == "SQLite")
                {
                    script = ArchAngel.Interfaces.ProjectOptions.DatabaseScripts.Utility.SQLiteScript;
                }

                if (script != null)
                {
                    ShowControl(databaseScriptEditor1);
                    databaseScriptEditor1.Populate(script, e.Node.Text);
                }
            }
        }