| 1 |
/****************************************************************************** |
|---|
| 2 |
x42view.net - .x42 viewer and auditing tool |
|---|
| 3 |
Copyright (C) 2007 HermitWorks Entertainment Corporation |
|---|
| 4 |
|
|---|
| 5 |
This program is free software; you can redistribute it and/or modify it |
|---|
| 6 |
under the terms of the GNU General Public License as published by the Free |
|---|
| 7 |
Software Foundation; either version 2 of the License, or (at your option) |
|---|
| 8 |
any later version. |
|---|
| 9 |
|
|---|
| 10 |
This program is distributed in the hope that it will be useful, but |
|---|
| 11 |
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
|---|
| 12 |
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|---|
| 13 |
for more details. |
|---|
| 14 |
|
|---|
| 15 |
You should have received a copy of the GNU General Public License along |
|---|
| 16 |
with this program; if not, write to the |
|---|
| 17 |
|
|---|
| 18 |
Free Software Foundation, Inc. |
|---|
| 19 |
51 Franklin Street, Fifth Floor |
|---|
| 20 |
Boston, MA 02110-1301, USA. |
|---|
| 21 |
******************************************************************************/ |
|---|
| 22 |
|
|---|
| 23 |
using System; |
|---|
| 24 |
using System.Collections.Generic; |
|---|
| 25 |
using System.Windows.Forms; |
|---|
| 26 |
|
|---|
| 27 |
namespace x42view |
|---|
| 28 |
{ |
|---|
| 29 |
static class Program |
|---|
| 30 |
{ |
|---|
| 31 |
/// <summary> |
|---|
| 32 |
/// The main entry point for the application. |
|---|
| 33 |
/// </summary> |
|---|
| 34 |
[STAThread] |
|---|
| 35 |
static int Main( string[] args ) |
|---|
| 36 |
{ |
|---|
| 37 |
if( Properties.Settings.Default.Settings_TryToUpgrade ) |
|---|
| 38 |
{ |
|---|
| 39 |
Properties.Settings.Default.Upgrade(); |
|---|
| 40 |
Properties.Settings.Default.Settings_TryToUpgrade = false; |
|---|
| 41 |
Properties.Settings.Default.Save(); |
|---|
| 42 |
} |
|---|
| 43 |
|
|---|
| 44 |
Application.EnableVisualStyles(); |
|---|
| 45 |
Application.SetCompatibleTextRenderingDefault( false ); |
|---|
| 46 |
|
|---|
| 47 |
Gui.MainWnd main = new Gui.MainWnd(); |
|---|
| 48 |
|
|---|
| 49 |
for( int i = 0; i < args.Length; i++ ) |
|---|
| 50 |
{ |
|---|
| 51 |
string arg = args[i]; |
|---|
| 52 |
|
|---|
| 53 |
if( string.Compare( arg, "-d", |
|---|
| 54 |
StringComparison.InvariantCultureIgnoreCase ) == 0 ) |
|---|
| 55 |
{ |
|---|
| 56 |
if( i + 2 < args.Length ) |
|---|
| 57 |
{ |
|---|
| 58 |
//open a diff window |
|---|
| 59 |
main.OpenDiffView( args[i + 1], args[i + 2] ); |
|---|
| 60 |
} |
|---|
| 61 |
|
|---|
| 62 |
i += 2; //-d expects two strings to follow, skip them |
|---|
| 63 |
continue; |
|---|
| 64 |
} |
|---|
| 65 |
|
|---|
| 66 |
//default is to just open the model |
|---|
| 67 |
main.OpenModelViewer( arg ); |
|---|
| 68 |
} |
|---|
| 69 |
|
|---|
| 70 |
Application.Run( main ); |
|---|
| 71 |
|
|---|
| 72 |
return 0; |
|---|
| 73 |
} |
|---|
| 74 |
} |
|---|
| 75 |
} |
|---|