Esempio n. 1
0
		private void GenerateFiles()
		{
			if (_selectedTable == null) return;
			if (IsValidFolder(_InputTemplateFolder) && IsValidFolder(_OutputTemplateFolder))
			{
				try
				{
					var generator = new FileGenerator();
					generator.OnComplete += FileGeneratorCompleted;
				    generator.CustomValue = _cvf.CustomValues;
					generator.Generate(_selectedTable, _InputTemplateFolder, _OutputTemplateFolder);
				}
				catch (Exception e)
				{
					MessageBox.Show(e.Message);
           
				}
			}
			else
			{
				SelectTemplatesDirectory();
			}
		}
Esempio n. 2
0
        private void GenerateFiles()
        {
            while ((IsValidFolder(_InputTemplateFolder) && IsValidFolder(_OutputTemplateFolder)) == false)
            {
                if (SelectDirectories() != DialogResult.OK)
                {
                    break;
                }
            }

            if (IsValidFolder(_InputTemplateFolder) && IsValidFolder(_OutputTemplateFolder))
            {
                try
                {
                    FileGenerator generator = new FileGenerator();
                    generator.OnComplete += new EventHandler(fileGenerator_Completed);
                    generator.CustomValue = GetCustomValues();
                    //generator.Generate(selectedTable, _InputTemplateFolder, _OutputTemplateFolder);
                    generator.Generate(selectedTables, _InputTemplateFolder, _OutputTemplateFolder);
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message);
                }
            }
        }