public void createproject() { try { if (System.Windows.Forms.MessageBox.Show("Creating Project will close all the open documents. Click Ok to continue or cancel to save the open documents..", "Technoturn - New project", System.Windows.Forms.MessageBoxButtons.OKCancel) == System.Windows.Forms.DialogResult.OK) { saveFileDialog1.Filter = "Java Project (*.tnjava)|*.tnjava|Html Project (*.tnhtml)|*.tnhtml|Php Project (*.tnphp)|*.tnphp|Visual basic Project (*.tnvb)|*.tnvb|CSharp Project (*.tncs)|*.tncs"; saveFileDialog1.Title = "Create New Project..."; if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { FileInfo fio = new FileInfo(saveFileDialog1.FileName); int retval = new CommonProg().new_project_create(fio.DirectoryName, new CommonProg().getfilename(fio.Name), new CommonProg().projecttype(fio.Extension)); if (retval == 1) { openfile(fio.DirectoryName + "/" + new CommonProg().getfilename(fio.Name) + "\\SourceFiles\\Main." + new CommonProg().fileextension(new CommonProg().projecttype(fio.Extension))); this.defaultprojectpath = fio.DirectoryName + "\\" + new CommonProg().getfilename(fio.Name); this.defaultfileformat = new CommonProg().fileextension(new CommonProg().projecttype(fio.Extension)); } static_project_path = fio.DirectoryName; } } } catch (Exception exp) { throw; } }
private void button1_Click(object sender, EventArgs e) { CommonProg pgcls = new CommonProg(); try { int retval = pgcls.new_project_create(pr_path.Text, Pr_name.Text, pr_type.SelectedIndex); if (retval == 1) { //new Home().createnewtab_project(); //new Home().Show(); //this.Dispose(); parent.openfile(pr_path.Text + "/" + Pr_name.Text + "/main." + pgcls.fileextension(pr_type.SelectedIndex)); this.Dispose(); } } catch (Exception ex) { pgcls.writeerrorlog(ex.Message); } }
public void createfile() { try { saveFileDialog1.Filter = "Java File (*.java)|*.java|Html File (*.html)|(*.html)|Javascript File (*.js)|(*.js)|XML File (*.xml)|(*.xml)|Php File (*.php)|(*.php) | Visual Basic File (*.vb)|(*.vb)|CSharp File (*.cs)|(*.cs)|All Files (*.*)|(*.*)"; saveFileDialog1.Title = "Create New File..."; saveFileDialog1.DefaultExt = "*." + this.defaultfileformat; saveFileDialog1.InitialDirectory = this.defaultprojectpath; saveFileDialog1.FileName = ""; if (saveFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) { FileInfo fio = new FileInfo(saveFileDialog1.FileName); int retval = new CommonProg().new_file_create(fio.DirectoryName, fio.Name); if (retval == 1) { openfile(fio.DirectoryName + "/" + fio.Name); } } } catch (Exception exp) { throw; } }