Click here to Skip to main content
15,895,799 members
Articles / Web Development / HTML

TypograFix: A Tool for Typographic HTML Beautification

Rate me:
Please Sign up or sign in to vote.
4.19/5 (12 votes)
20 Dec 2008CPOL3 min read 32.2K   377   19  
Presents a script/tool for typographic HTML reprocessing
namespace TypograFix
{
  using System.Windows;
  using System.Windows.Threading;
  using Properties;

  /// <summary>
  /// Interaction logic for App.xaml
  /// </summary>
  public sealed partial class App : Application
  {
    internal static ConversionOptions ConversionOptions { get; set; }

    internal static string EntryText = string.Empty;

    private void OnUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
    {
      MessageBox.Show(
        "Unhandled exception: " + e,
        "Unhandled exception", MessageBoxButton.OK);
    }

    private void Application_Startup(object sender, StartupEventArgs e)
    {
      ConversionOptions = new ConversionOptions();

      if (Settings.Default != null && 
          Settings.Default["EntryText"] != null)
      {
        string s = Settings.Default["EntryText"] as string;
        if (!string.IsNullOrEmpty(s))
          EntryText = s;
      }
    }

    private void Application_Exit(object sender, ExitEventArgs e)
    {
      Settings.Default["EntryText"] = EntryText;
      Settings.Default.Save();
    }
  }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Founder ActiveMesa
United Kingdom United Kingdom
I work primarily with the .NET technology stack, and specialize in accelerated code production via code generation (static or dynamic), aspect-oriented programming, MDA, domain-specific languages and anything else that gets products out the door faster. My languages of choice are C# and C++, though I'm open to suggestions.

Comments and Discussions