Skip to content

Commit

Permalink
command line test
Browse files Browse the repository at this point in the history
  • Loading branch information
seuffert committed Mar 14, 2011
1 parent 9c89d27 commit a21526c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
4 changes: 3 additions & 1 deletion XBSlink/CommandLine.cs
Expand Up @@ -7,13 +7,15 @@ namespace XBSlink
{ {
class CommandLine class CommandLine
{ {
xbs_settings xbs_settings = null;
public static xbs_udp_listener udp_listener = null; public static xbs_udp_listener udp_listener = null;
public static xbs_sniffer sniffer = null; public static xbs_sniffer sniffer = null;
public static xbs_node_list node_list = null; public static xbs_node_list node_list = null;
private xbs_natstun natstun = null; private xbs_natstun natstun = null;


public CommandLine() public CommandLine(xbs_settings settings)
{ {
xbs_settings = settings;
node_list = new xbs_node_list(); node_list = new xbs_node_list();
udp_listener = new xbs_udp_listener(); udp_listener = new xbs_udp_listener();
natstun = new xbs_natstun(); natstun = new xbs_natstun();
Expand Down
29 changes: 19 additions & 10 deletions XBSlink/Program.cs
Expand Up @@ -29,27 +29,36 @@ static class Program
{ {
public static FormMain main_form = null; public static FormMain main_form = null;
public static xbs_settings settings = null; public static xbs_settings settings = null;
private static CommandLine console_app = null;
/// <summary> /// <summary>
/// Der Haupteinstiegspunkt für die Anwendung. /// Der Haupteinstiegspunkt für die Anwendung.
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main() static void Main(string[] args)
{ {
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
settings = new xbs_settings(); 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 ) if (main_form != null)
Application.Run(main_form); Application.Run(main_form);
}
} }
} }
} }
1 change: 1 addition & 0 deletions XBSlink/XBSlink.csproj
Expand Up @@ -88,6 +88,7 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="CommandLine.cs" />
<Compile Include="ExceptionMessage.cs"> <Compile Include="ExceptionMessage.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
Expand Down

0 comments on commit a21526c

Please sign in to comment.