コード例 #1
0
ファイル: MainForm.cs プロジェクト: zombisaur/iggy
 void LoadDocumentAsync(string fileName)
 {
     var progress = new ProgressDialog
     {
         Title = "Loading file",
         TaskFunction = (p) => StartLoadFile(fileName, p),
     };
     if (progress.ShowDialog() == DialogResult.OK)
     {
         var task = (Task<RuleIndex>)progress.Task;
         SetupDocument(task.Result);
     }
 }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: zombisaur/iggy
 void OnConvert(object sender, EventArgs e)
 {
     var progress = new ProgressDialog
     {
         Title = "Loading file",
         TaskFunction = (p) => Task.Factory.StartNew(() =>
             {
                 string newPath = Path.ChangeExtension(this.currentDocument.Name, ".js");
                 using (FileStream stream = File.Open(newPath, FileMode.Create))
                 {
                     using (var writer = new StreamWriter(stream))
                     {
                         Converter.Convert(this.currentDocument, writer, p);
                     }
                 }
             })
     };
     progress.ShowDialog();
 }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: seanohue/iggy
 void OnConvertToFiles(object sender, EventArgs e)
 {
     var progress = new ProgressDialog
     {
         Title = "Converting file",
         TaskFunction = (p) => Task.Factory.StartNew(() =>
         {
             string newPath = Path.ChangeExtension(this.currentDocument.Name, ".out");
             Converter.ConvertToFiles(this.currentDocument, newPath, p);
         })
     };
     progress.ShowDialog();
 }