Changeset 2538


Ignore:
Timestamp:
3/17/2012 2:50:27 AM (3 years ago)
Author:
lowjoel
Message:

Move the call to Application.EnableVisualStyles? to the start of the program so that if a console window creates a WinForm?, it would have the correct behaviour.
Fixing this bug also fixes the drawing problems associated with the display of the shell erase confirmation dialog.

Location:
trunk/eraser/Eraser
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/eraser/Eraser/Program.GuiProgram.cs

    r2516 r2538  
    5353            public GuiProgram(string[] commandLine, string instanceID) 
    5454            { 
    55                 Application.EnableVisualStyles(); 
    56                 Application.SetCompatibleTextRenderingDefault(false); 
    5755                InstanceID = instanceID; 
    5856                CommandLine = commandLine; 
  • trunk/eraser/Eraser/Program.cs

    r2535 r2538  
    232232            Args parsedArguments = (Args)argumentParser.Item; 
    233233 
     234            //Set application defaults for consistent behaviour across GUI and 
     235            //Console instances 
     236            Application.EnableVisualStyles(); 
     237            Application.SetCompatibleTextRenderingDefault(false); 
     238 
    234239            //Load the Eraser.Manager library 
    235240            using (ManagerLibrary library = new ManagerLibrary(Settings.Get())) 
     
    601606            Task task = TaskFromCommandLine(arguments); 
    602607 
    603             //Do we have a parent dialog? 
    604             IWin32Window parent = null; 
    605             if (!string.IsNullOrEmpty(arguments.Parent)) 
    606             { 
    607                 parent = new Win32Window((IntPtr)(ulong) 
    608                     Convert.ChangeType(arguments.Parent, typeof(ulong))); 
    609             } 
    610  
    611608            //Confirm that the user wants the erase. 
    612609            if (arguments.Confirm) 
    613610            { 
    614                 Application.EnableVisualStyles(); 
     611                //Do we have a parent dialog? 
     612                IWin32Window parent = null; 
     613                if (!string.IsNullOrEmpty(arguments.Parent)) 
     614                { 
     615                    parent = new Win32Window((IntPtr)(ulong) 
     616                        Convert.ChangeType(arguments.Parent, typeof(ulong))); 
     617                } 
     618 
    615619                using (Form dialog = new ShellConfirmationDialog(task)) 
    616620                { 
Note: See TracChangeset for help on using the changeset viewer.