示例#1
0
        public WTFProject Create(string outputDir, string projectFile, string projectName)
        {
            string wtfFileText = @"BEGIN System.Windows.Forms.Form MainForm
    Text = ""MainForm""
    Name = ""Form1""
    Size = System.Drawing.Size(500, 300)
ENDOBJECT
";
            string lsFileText = @";;; L# in WindowsTextFoundation sample
;;; WTF Is basically wpf except text version, no visual designer, and for L#.
;;; even so, Windows Text Foundation can easily let 
;;; you create forms and put controls on them.
;;; Then, in your L# code, you can access that 
;;; object through the name you gave it in the
;;; .wtf file.

;;; example: reference the MainForm object created in wtf
;;; and show it to the user
(showdialog MainForm)
";
            System.IO.File.WriteAllText(outputDir + "\\MainForm.wtf", wtfFileText);
            System.IO.File.WriteAllText(outputDir + "\\main.ls", lsFileText);
            WTFProject proj = new WTFProject();
            proj.Files.Add(new File(outputDir + "\\MainForm.wtf"));
            proj.Files.Add(new File(outputDir + "\\main.ls"));
            proj.CompileOutputType = WindowsTextFoundation.LSharpProvider.Compiler.OutputType.Exe;
            proj.XmlFilename = projectFile;
            proj.ProjectName = projectName;
            proj.Save(projectFile);
            proj.Load(projectFile);
            return proj;
        }
示例#2
0
        public WTFProject Create(string outputDir, string projectFile, string projectName)
        {
            string wtfFileText = @"BEGIN System.Windows.Forms.Form MainForm
    Text = ""MainForm""
    Name = ""Form1""
    Size = System.Drawing.Size(500, 300)
ENDOBJECT
";
            string lsFileText = ";;; Show WTF Form\r\n(showdialog MainForm)";
            System.IO.File.WriteAllText(outputDir + "\\MainForm.wtf", wtfFileText);
            System.IO.File.WriteAllText(outputDir + "\\main.ls", lsFileText);
            WTFProject proj = new WTFProject();
            proj.Files.Add(new File(outputDir + "\\MainForm.wtf"));
            proj.Files.Add(new File(outputDir + "\\main.ls"));
            proj.CompileOutputType = WindowsTextFoundation.LSharpProvider.Compiler.OutputType.WinFormsExe;
            proj.XmlFilename = projectFile;
            proj.ProjectName = projectName;
            proj.Save(projectFile);
            proj.Load(projectFile);
            return proj;
        }