Exemple #1
0
 private void saveAsHTMLToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (String.IsNullOrEmpty(saveAsHtmlDialog.FileName))
     {
         saveAsHtmlDialog.FileName = appPal.PaletteName;
     }
     if (saveAsHtmlDialog.ShowDialog(this) == DialogResult.OK)
     {
         File.WriteAllText(saveAsHtmlDialog.FileName,
                           HtmlProofGenerator.GeneratePage(appPal.Palette)
                           );
     }
 }
Exemple #2
0
        private void saveAsHTMLProofToolStripMenuItem_Click(object sender, EventArgs e)
        {
            var title = String.Format("{0} of {1}", app.SchemeType, app.Color.ToHtml());

            if (String.IsNullOrEmpty(saveAsHtmlDialog.FileName))
            {
                saveAsHtmlDialog.FileName = title;
            }
            if (saveAsHtmlDialog.ShowDialog(this) == DialogResult.OK)
            {
                File.WriteAllText(saveAsHtmlDialog.FileName,
                                  HtmlProofGenerator.GeneratePage(title,
                                                                  HtmlProofGenerator.GenerateTable(app.Results))
                                  );
            }
        }
Exemple #3
0
    protected void OnExportHTMLActionActivated(object sender, EventArgs e)
    {
        FileChooserDialog fd = new FileChooserDialog("Save as HTML", this,
                                                     FileChooserAction.Save, "Cancel", ResponseType.Cancel, "OK", ResponseType.Ok);
        FileFilter ff = new FileFilter();

        ff.Name = "HTML";
        ff.AddMimeType("text/html");
        ff.AddPattern("*.html");
        fd.AddFilter(ff);
        if (fd.Run() == (int)ResponseType.Ok)
        {
            File.WriteAllText(fd.Filename,
                              HtmlProofGenerator.GeneratePage(
                                  appPal.Palette
                                  )
                              );
        }
        fd.Destroy();
    }
Exemple #4
0
    protected void OnSaveAsHTMLColorActionActivated(object sender, EventArgs e)
    {
        FileChooserDialog fd = new FileChooserDialog("Save as HTML", this,
                                                     FileChooserAction.Save, "Cancel", ResponseType.Cancel, "OK", ResponseType.Ok);
        FileFilter ff = new FileFilter();

        ff.Name = "HTML";
        ff.AddMimeType("text/html");
        ff.AddPattern("*.html");
        fd.AddFilter(ff);
        if (fd.Run() == (int)ResponseType.Ok)
        {
            File.WriteAllText(fd.Filename,
                              HtmlProofGenerator.GeneratePage(
                                  String.Format("{0} for {1}", app.SchemeType,
                                                app.Color.ToHtml()),
                                  HtmlProofGenerator.GenerateTable(app.Results)
                                  )
                              );
        }
        fd.Destroy();
    }