Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            ConsoleLog       log     = new ConsoleLog();
            DiscoveryServer  dserver = new DiscoveryServer(log);
            IInputController inputController;

            switch (System.Environment.OSVersion.Platform)
            {
            case PlatformID.Win32NT:
                inputController = new WinInputController();
                break;

            case PlatformID.Unix:
                inputController = new LinInputController();
                break;

            default:
                Console.WriteLine("Environment not supported");
                return;
            }

            InputServer.InputServer iserver = new InputServer.InputServer(log, inputController);

            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();

            iserver.Dispose();
            dserver.Dispose();
        }
Ejemplo n.º 2
0
        public MainForm()
        {
            InitializeComponent();

            // log
            foreach (string arg in Environment.GetCommandLineArgs())
            {
                if (arg == "--log")
                {
                    useLog = true;
                }
            }
            ILog log;

            miLog.Visible = useLog;
            if (useLog)
            {
                logForm = new LogForm();
                log     = new TextBoxLog(logForm.TextBox);
            }
            else
            {
                log = new NullLog();
            }

            // version string
            lbVersion.Text = GetVersion();

            // ip address
            try
            {
                lbIpAddr.Text = GetIpAddress();
            }
            catch
            {
                lbIpAddr.Text = "Unknown";
            }

            // input controller
            inputController = new WinInputController();

            // services
            dserver = new DiscoveryServer(log);
            iserver = new InputServer.InputServer(log, inputController);

            // hide window
            WindowState   = FormWindowState.Minimized;
            ShowInTaskbar = false;
        }