Ejemplo n.º 1
0
        private void CreateWorkflow()
        {
            var form = new PageForm(string.Empty);

            form.OnBeforeSave += (ss, ee) =>
            {
                if (form.FileName == string.Empty)
                {
                    using (var file = new SaveFileDialog())
                    {
                        file.Filter = FileDialogFilter;
                        if (file.ShowDialog() == DialogResult.OK)
                        {
                            form.FileName = file.FileName;
                        }
                        else
                        {
                            return;
                        }
                    }
                }
                File.WriteAllText(form.FileName, form.FileContent);
            };
            form.Show();
        }
Ejemplo n.º 2
0
 private void OpenWorkflow()
 {
     using (var file = new OpenFileDialog())
     {
         file.Filter = FileDialogFilter;
         if (file.ShowDialog() == DialogResult.OK)
         {
             var form = new PageForm(File.ReadAllText(file.FileName));
             form.OnBeforeSave += (ss, ee) => File.WriteAllText(form.FileName, form.FileContent);
             form.FileName      = file.FileName;
             form.Show();
         }
     }
 }