public void write_end(string key) { StreamWriter pWriter = (StreamWriter)FrmApp.pMap.find(key); S_File_Text.Write_End(pWriter); }
private void menuItem2_Click_1(object sender, EventArgs e) { if (saveFileDialog1.ShowDialog() != DialogResult.OK) { return; } string strFile = saveFileDialog1.FileName; if (strFile.EndsWith(".form.js") == false) { strFile += ".form.js"; } StreamWriter pWriter = S_File_Text.Write_Begin(strFile, false); string strLine = ""; foreach (Control p in host.Container.Components) { string strEvent = ""; string strData = ""; if (p.Tag != null) { string[] strSplit = p.Tag.ToString().Split(':'); strEvent = strSplit[0]; if (strSplit.Length > 1) { strData = strSplit[1]; } } switch (p.GetType().Name) { case "Form": break; case "CheckBox": break; case "Label": break; case "TextBox": strLine = "sys.Add_Text(\"" + p.Name + "\",\"" + p.Text + "\"," + p.Left + "," + p.Top + "," + p.Width + "," + p.Height + ");"; S_File_Text.Write_Line(ref pWriter, strLine); break; case "Button": strLine = "sys.Add_Button(\"" + p.Name + "\",\"" + p.Text + "\"," + p.Left + "," + p.Top + "," + p.Width + "," + p.Height + ",\"" + strEvent + "\",\"" + strData + "\");"; S_File_Text.Write_Line(ref pWriter, strLine); break; } Console.Write(p.Text); } foreach (Control p in host.Container.Components) { string strEvent = ""; string strData = ""; if (p.Tag != null) { string[] strSplit = p.Tag.ToString().Split(':'); strEvent = strSplit[0]; if (strSplit.Length > 1) { strData = strSplit[1]; } } switch (p.GetType().Name) { case "Form": strLine = "sys.Show_Form(" + p.Width + ", " + p.Height + ");"; S_File_Text.Write_Line(ref pWriter, strLine); break; } Console.Write(p.Text); } S_File_Text.Write_End(ref pWriter); }