~charlie.poole/nunitv2/equality-handlers

« back to all changes in this revision

Viewing changes to src/GuiRunner/nunit-gui/AppEntry.cs

  • Committer: Charlie Poole
  • Date: 2011-03-29 21:54:46 UTC
  • mfrom: (3257.4.15 standalone-editor)
  • Revision ID: charlie@nunit.org-20110329215446-pu1r6okg4www4zat
Remove integrated project editor and substitute new standalone editor

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// ****************************************************************
2
 
// This is free software licensed under the NUnit license. You
3
 
// may obtain a copy of the license as well as information regarding
4
 
// copyright ownership at http://nunit.org.
 
2
// Copyright 2011, Charlie Poole
 
3
// This is free software licensed under the NUnit license. You may
 
4
// obtain a copy of the license at http://nunit.org
5
5
// ****************************************************************
6
6
 
7
7
using System;
46
46
                attachedConsole = new GuiAttachedConsole();
47
47
            }
48
48
 
49
 
            if (!guiOptions.Validate() || guiOptions.help)
50
 
            {
51
 
                string message = guiOptions.GetHelpText();
52
 
                UserMessage.DisplayFailure(message, "Help Syntax");
53
 
                log.Error("Command line error: " + message);
 
49
            if (guiOptions.help)
 
50
            {
 
51
                MessageDisplay.Display(guiOptions.GetHelpText());
 
52
                return 0;
 
53
            }
 
54
 
 
55
            if (!guiOptions.Validate())
 
56
            {
 
57
                string message = "Error in command line";
 
58
                MessageDisplay.Error(message + Environment.NewLine + Environment.NewLine + guiOptions.GetHelpText());
 
59
                log.Error(message);
54
60
                return 2;
55
61
            }
56
62
 
90
96
            }
91
97
            catch (Exception ex)
92
98
            {
93
 
                UserMessage.DisplayFatalError(ex, null, "Unable to Initialize Services");
94
 
                log.Error("Unable to initialize services", ex);
 
99
                MessageDisplay.FatalError("Service initialization failed.", ex);
 
100
                log.Error("Service initialization failed", ex);
95
101
                return 2;
96
102
            }
97
103
 
135
141
 
136
142
            return 0;
137
143
        }
 
144
 
 
145
        private static IMessageDisplay MessageDisplay
 
146
        {
 
147
            get { return new MessageDisplay("NUnit"); }
 
148
        }
138
149
    }
139
150
}