Permalink
Browse files

command line test

  • Loading branch information...
1 parent 9c89d27 commit a21526c0833303d5c0ec634b2f28a9f4cb5cae8a @seuffert committed Mar 14, 2011
Showing with 23 additions and 11 deletions.
  1. +3 −1 XBSlink/CommandLine.cs
  2. +19 −10 XBSlink/Program.cs
  3. +1 −0 XBSlink/XBSlink.csproj
View
4 XBSlink/CommandLine.cs
@@ -7,13 +7,15 @@ namespace XBSlink
{
class CommandLine
{
+ xbs_settings xbs_settings = null;
public static xbs_udp_listener udp_listener = null;
public static xbs_sniffer sniffer = null;
public static xbs_node_list node_list = null;
private xbs_natstun natstun = null;
- public CommandLine()
+ public CommandLine(xbs_settings settings)
{
+ xbs_settings = settings;
node_list = new xbs_node_list();
udp_listener = new xbs_udp_listener();
natstun = new xbs_natstun();
View
29 XBSlink/Program.cs
@@ -29,27 +29,36 @@ static class Program
{
public static FormMain main_form = null;
public static xbs_settings settings = null;
+ private static CommandLine console_app = null;
/// <summary>
/// Der Haupteinstiegspunkt für die Anwendung.
/// </summary>
[STAThread]
- static void Main()
+ static void Main(string[] args)
{
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
settings = new xbs_settings();
- try
+ if (args.Length > 1)
{
- main_form = new FormMain();
+ console_app = new CommandLine(settings);
}
- catch (ApplicationException)
+ else
{
- main_form = null;
- }
+ Application.EnableVisualStyles();
+ Application.SetCompatibleTextRenderingDefault(false);
+
+ try
+ {
+ main_form = new FormMain();
+ }
+ catch (ApplicationException)
+ {
+ main_form = null;
+ }
- if (main_form != null )
- Application.Run(main_form);
+ if (main_form != null)
+ Application.Run(main_form);
+ }
}
}
}
View
1 XBSlink/XBSlink.csproj
@@ -88,6 +88,7 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
+ <Compile Include="CommandLine.cs" />
<Compile Include="ExceptionMessage.cs">
<SubType>Form</SubType>
</Compile>

0 comments on commit a21526c

Please sign in to comment.