public void Execute(IMenuCommand command) { IDiagram diagram = this.DiagramContext.CurrentDiagram; IModelStore modelStore = diagram.ModelStore; string SqlFile = @"C:\MyLoStore\MyLoStorePostgres.sql"; string PythonFile = @"C:\MyLoStore\MyLoStore.py"; FolderBrowserDialog openFolderDialog1 = new FolderBrowserDialog(); openFolderDialog1.RootFolder = Environment.SpecialFolder.MyComputer; openFolderDialog1.Description = "Select the directory that you want to use for generated output"; if (openFolderDialog1.ShowDialog() == DialogResult.OK) { string folderName = openFolderDialog1.SelectedPath; SqlFile = folderName + @"\MyLoStorePostgres.sql"; PythonFile = folderName + @"\MyLoStore.py"; using (StreamWriter fsSql = new StreamWriter(SqlFile, false)) { using (StreamWriter fsPy = new StreamWriter(PythonFile, false)) { SQLWriter mySql = new SQLWriter(SQLGenerateRun.Postgres); PythonClassWriter py = new PythonClassWriter(); SQLGenerator sqlGen = new SQLGenerator(fsSql, mySql, fsPy, py, modelStore); sqlGen.GenerateMySQL(); } } } }
public void Execute(IMenuCommand command) { IDiagram diagram = this.DiagramContext.CurrentDiagram; IModelStore modelStore = diagram.ModelStore; const string SqlFile = @"C:\PLDB\PLDBmysql.sql"; const string PythonFile = @"C:\PLDB\PLDB.py"; using (StreamWriter fsSql = new StreamWriter(SqlFile)) { using (StreamWriter fsPy = new StreamWriter(PythonFile)) { SQLWriter mySql = new SQLWriter(SQLGenerateRun.MyISAM); PythonClassWriter py = new PythonClassWriter(); SQLGenerator sqlGen = new SQLGenerator(fsSql, mySql, fsPy, py, modelStore); sqlGen.GenerateMySQL(); } } }